multiple callback URIs in Developer App

nsaini
New Member

Hi

We have a requirement to support multiple callback URI for developer app.As per :

https://docs.apigee.com/api-platform/security/oauth/advanced-oauth-20-topics#designatingmultiplecall...

we have created developer app with empty callback uri, but when using authorisation_code grant type to generate auth code, the oauthv2 policy fails with invalid redirect url error.

Can anyone tell what else needs to be done?

0 6 489
6 REPLIES 6

nsaini
New Member

@Dino-at-Google could you pls help here

Not applicable

Hi,

if you want to have multiple callback urls then you have to use a javascript policy where you can set the redirect_uri. To get all callback urls as a string inside javascript you can use context.getVariable("app_redirect_uri").

In the next part when you are saying you have put empty callback URI then you must specify a redirect_uri parameter in the request, else it will throw an error.

Hi

I have a scenario identical to the above where there can be multiple callback URLs - one for each environment. Can you give me the code to set multiple callback urls as per the referrer url.

like if dev.UIAPP.com --> callback url should be dev.UIAPP.com/login

sit.UIAPP.com --> callback url should be sit.UIAPP.com/login

Should I create a Javascript policy before the VerifyAPI Key Step and use something like

if refererr.url = dev.UIAPP.com

then context.setVariable("app_redirect_uri","callbackURL_value")

Kindly help as I am not getting any documentation

Hi

usually if you have a new question it's best to ask a new question. I know your question is related to the existing one, but if people just ask questions in comments attached to answers.... it confuses the discussion and makes it hard to know what question is being asked and what answer is appropriate.

In your situation there are other approaches that we'd recommend. Please ask a new question and we'll discuss there.

@Priyadarshi Ajitav Jena Kindly provide your inputs if possible

Sure . I will do that right away