Variables allowed in redirect_uri???


Variables allowed in redirect_uri???

I'm working on an app that requires a different URL for each user.  In order to OAuth2 authenticate, I need them returned to a url specific to the user.  How can I configure this?  It seems that I must register my redirect_uri and it has to be the same for all calls.


Is this correct, or can I use a custom URL for each user?






Your redirect URI does need to match exactly and apply to all of your users, so you would basically have to work around that in one of two ways to make this function the way you want it to, depending on whether the base url can stay the same.


1.  Base URL stays the same.  You can have a redirect of, appending it with a fully encoded ID at the end, to make the ID unique to each user in your code.  That way the redirect uri stays the same for our system, but you get to have a unique landing page for each user.


2.  The base URL changes.  You would have to do a redirect on a redirect.  Basically, you will have the user information for each person, so your redirect url page will have to contain code that checks for a user's unique identifier (whether it's their username or something else) and then redirect based on their unique identifiers.


Sorry for the limitation, but I hope that helps as to a workaround.  


Best Regards,

Shannon W.

API Support Specialist

Occasional Participant

Can you include some URI examples of that?


I am attempting to have a redirect uri of:


Is this possible?

Hi Christine,


That is a valid redirect uri to use. Just keep in mind that it must match exactly in Mashery and what you pass to us in the first authorization call. If you have in Mashery, the first call you make to us to get the authorization code (or access token, if you're using the client side Oauth2 flow) can't be (with any parameters appended to the redirect uri).


You can review the OAuth2 authorization process for both server and client flow at the links below.


Best Regards,
Shannon Wallace
Partner API Support Engineer

Developer Portal

View API documentation, code samples, get your API key.

Visit Page