Varying redirect URL

Highlighted
Visitor

Varying redirect URL

I need to include an account ID in the redirect URL I send during the request I make for an access token.  I send a  redirect URL like this (123 is a varying ID) when making the request for the authorization URL to CTCT:

http://my-domain.com/oauthlanding/123

 

In mashery my redirect URL looks like this:

http://my-domain.com/oauthlanding/

 

I get the error that the redirect URLs don't match.

 

Obviously these 2 URLs don't match.  Is there a way to do what facebook does and just specify a domain name that any redirects can go to rather than have to hardcode the URL in mashery?  Or maybe some sort of wildcard?  Since one of my users can potentially link their account to multiple constant contact accounts I need to be able to designate which one I am getting the access token for.

 

1 REPLY 1
Highlighted
Moderator

Re: Varying redirect URL

We do require, per the OAuth 2.0 spec, that the base redirect URI (which includes host and path) matches the one of file.  What both the OAuth 2.0 spec and Constant Contact recommend is to use a query parameter for request specific data, such as http://www.yourdomain.com?id=abc.  Query parameters are passed as part of the redirect URL exactly as they are sent to us in the initial request.  You can then use the query parameters to process the requesst, do an additional redirect on your domain, etc. 

Dave Berard
Senior Product Manager, Constant Contact
Developer Portal

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

Visit Page

Constant Contact Would Like To Hear From You!

We want to hear from customers like you about your favorite features and how they have helped your business or organization. Tell us by answering a few questions in...

Read More
Featured