See the Casa script for ideas about how to switch between different scripts. There is also a router script which may give you some ideas
[https://github.com/GluuFederation/oxAuth/tree/master/Server/integrations/acr_router](https://github.com/GluuFederation/oxAuth/tree/master/Server/integrations/acr_router)