The Community is hosting an End of Summer sweepstakes! Participants must complete tasks to earn tickets that will enter them with a chance to win a free year of Constant Contact and other great prizes!*
*No Purchase Necessary. For Official Rules, visit here. Constant Contact’s End of Summer 2020 Sweepstakes ends on October, 20, 2020 at 11:50 PM EST.

Variables allowed in redirect_uri???

Highlighted
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
Highlighted
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

Highlighted
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?

Highlighted
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

Developer Portal

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

Visit Page

Constant Contact 2020 End of Summer Community Sweepstakes!

The Constant Contact User Community is hosting a sweepstakes. The more you participate, the more chances you have to win! Read on to learn more...

Read More
Featured