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.

Getting username from OAuth

Highlighted
New Member

Getting username from OAuth

I'm using OAuth to authenticate in a three-legged scenerio.  I'm able to receive the  access token and secret, but I'm confused about the last part.  Step 4 says "Now you can call any Constant Contact REST based API using OAuth."  My problem is that all of the API documentation shows making calls to urls that include the username, but I don't have the username.  Best I can tell there isn't an api call I can make to get the username either.  Services like twitter solve this problem by passing back the username along with the access token.


So my questions boils down to:  


Is there a way to make calls to the api without a username?


And if not . . .


Is there a way to get the username from the API?


Thanks,


Tony


 




5 REPLIES 5
Highlighted
Employee

Oauth username

Hello Tony,



I did some testing and I do see that if you do not know the username already, you would have to ask for it, on top of them having to put it in for the OAuth access token authentication.



I spoke with our developers on this issue and they also agree that this is something that should be implemented. I am going to put a request in and they are going to look into implementing this.



If you have any questions about this issue, please let me know.



Regards,

Benjamin Soder
NOC Analyst
Constant Contact
Highlighted
Occasional Contributor

Re: Oauth username

Hello,

 

Has this issue been resolved yet? I don't understand how to use the API for an integration with this.

 

For example, I want the user to use oauth2 with constant contact and then I'll show him his contact lists so he can select one to use with my application. But according to this thread I need to not only get them to log into constant contact through oauth2 but then ask for their username again? This doesn't seem right. Can't you pass back the username with the token?


~Elan

Highlighted
Employee

Re: Oauth username

Hey Elan,

 

We are aware of the issue and are working to resolve it.  The best work around available is get the username in a text box and pass it through the post or store into a session.  I understand that this is not the most user-friendly but it is a work around and we are looking into a fix to get the username returned.

 

Please let me know if this helps.

Ryan Davis
Quality Engineer
Highlighted
Occasional Participant

Re: Oauth username

Should Oauth be used for out-of-band requests?  For example, for an opt-in signup?

Highlighted
Moderator

Re: Oauth username

OAuth 1.0/2.0 can be used for any integration you would like.  Given the ease of using OAuth 2.0, it is highly recommended that you use this method of authentication for integrations.  You can alternatively use Basic authentication as well. 

Dave Berard
Senior Product Manager, Constant Contact
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