cancel
Showing results for 
Search instead for 
Did you mean: 
Due to an issue with YouTube, inserting videos in your emails is showing an error. Until they are able to resolve this issue, we recommend using a different video hosting service. We will continue to monitor this outage and update you as we have more information.

Variables allowed in redirect_uri???

Member

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?

 

Thanks!

3 REPLIES 3
CTCT Employee

Re: Variables allowed in redirect_uri???

Hi,

 

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 http://example.com, 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

Visitor

Re: Variables allowed in redirect_uri???

Can you include some URI examples of that?

 

I am attempting to have a redirect uri of:

 

http://www.domain.com/oauthcc/constantcontact/1234-5567-abc-345

 

Is this possible?

CTCT Employee

Re: Variables allowed in redirect_uri???

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 http://www.domain.com/oauth2cc/constantcontact/123-456-abc 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 http://www.domain.com/oauth2cc/constantcontact/123-456-abc?parameter=something (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.

 

http://developer.constantcontact.com/docs/developer-guides/oauth-2.0-server-flow.html

 

http://developer.constantcontact.com/docs/developer-guides/oauth-2.0-client-flow.html

 

Best Regards,
Shannon Wallace
Partner API Support Engineer