Internal Server Error during OAuth

SOLVED
Go to solution
TaraM507
Rookie
0 Votes

Hello Constant Contact's API Support!

I'm currently trying to use OAuth2 Authorization Code Flow to retrieve an authorization code for my integration.
After making a request to the OAuth server, I am being returned a 200 status with some html in the response body, which I am rendering.

Unfortunately the view where the user should be prompted to sign in to authenticate their user account is printing the message "There was an unexpected internal error. Please try again."

Does anyone have any insight how I can resolve this? I've attached the source for my client app, and if I can provide any more context I would be happy to. I just want to get my authorization code! 

Thank you for any thoughts or help!

Screenshot from 2023-10-20 10-51-43.pngScreenshot from 2023-10-20 10-52-22.png

1 ACCEPTED SOLUTION
Courtney_E
Employee

Hello TaraM507,

 

Thank you for reaching out to Constant Contact API Developer Support. My team is here to assist outside software developers with questions about building into Constant Contact's API.

 

Based on the response that you are getting, which appears to be the html for Constant Contact’s login page, I suspect you may be trying to execute the OAuth2 authorization behind the scenes.

 

The Authorization Request screen can only be accessed/authorized via a browser window or a pop up browser dialog, but you should only need to authorize/connect each account once via this method.

 

You should be able to fully automate your integration with the exception of the initial Authorization Request screen and redirect, which can only be accessed/authorized via a browser window and cannot be bypassed, but you should only need to authorize each connected account once.

 

The Authorization Request screen is only for connecting a Constant Contact account to the integration, so for example if you are making a sign-up form or integration that only connects to one Constant Contact account, only you would access the Authorization Request screen one initial time to connect your account, it wouldn't be visible to people using the form/integration.  When your users are accessing the integration, it will use the token set generated when you initially granted permission to access the connection. The only time other people would access the Authorization Request screen is if you are designing an integration that needs to connect to other Constant Contact accounts, as each account needs to grant permission to the integration.

 

Please have a look and let us know if you have any other questions!

 

You can also reach our team directly/securely via email at webservices@constantcontact.com


Regards,

Courtney E.
Tier II API Support Engineer

Did I answer your question?
If so, please mark my post as an "Accepted Solution" by clicking the Accept as Solution button in the bottom right hand corner of this post.

View solution in original post

3 REPLIES 3
Courtney_E
Employee

Hello TaraM507,

 

Thank you for reaching out to Constant Contact API Developer Support. My team is here to assist outside software developers with questions about building into Constant Contact's API.

 

Based on the response that you are getting, which appears to be the html for Constant Contact’s login page, I suspect you may be trying to execute the OAuth2 authorization behind the scenes.

 

The Authorization Request screen can only be accessed/authorized via a browser window or a pop up browser dialog, but you should only need to authorize/connect each account once via this method.

 

You should be able to fully automate your integration with the exception of the initial Authorization Request screen and redirect, which can only be accessed/authorized via a browser window and cannot be bypassed, but you should only need to authorize each connected account once.

 

The Authorization Request screen is only for connecting a Constant Contact account to the integration, so for example if you are making a sign-up form or integration that only connects to one Constant Contact account, only you would access the Authorization Request screen one initial time to connect your account, it wouldn't be visible to people using the form/integration.  When your users are accessing the integration, it will use the token set generated when you initially granted permission to access the connection. The only time other people would access the Authorization Request screen is if you are designing an integration that needs to connect to other Constant Contact accounts, as each account needs to grant permission to the integration.

 

Please have a look and let us know if you have any other questions!

 

You can also reach our team directly/securely via email at webservices@constantcontact.com


Regards,

Courtney E.
Tier II API Support Engineer

Did I answer your question?
If so, please mark my post as an "Accepted Solution" by clicking the Accept as Solution button in the bottom right hand corner of this post.
TaraM507
Rookie
0 Votes

Hello Courtney_E, thank you for reaching out!

Based on the response that you are getting, which appears to be the html for Constant Contact’s login page, I suspect you may be trying to execute the OAuth2 authorization behind the scenes.

 

The Authorization Request screen can only be accessed/authorized via a browser window or a pop up browser dialog, but you should only need to authorize/connect each account once via this method.



I am interacting with the integration app via browser, and trying to use the browser to let the user log in (shown in the picture below).
The problem I'm running into I'm just being given a Constant Contact error in the UI, instead of a login form.

 

  • My app is running on http://localhost:8080/oauth 
  • When the user navigates to this page it makes a request to the Constant Contact Auth server, which responds with HTML
  • I then redirect the user to this response HTML

    If I'm understanding correctly this is the initial auth flow outlined in the documentation. So I am curious what I may be missing that is causing this error to be displayed when the response is a 200 status.

    Again, I greatly appreciate your thoughts and help :smileyface:  


TaraM507_0-1698077647866.png

 

John__B
Employee

Hello TaraM507,

 

Thank you for reaching out to Constant Contact API Developer Support. My team is here to assist outside software developers with questions about building into Constant Contact's API.

 

It looks like we've already followed up with you directly via email, but I wanted to close the loop here as well. If you haven't received our reply, please let us know via email at webservices@constantcontact.com, and reference case number 31699378 .

 

Please have a look and let us know if you have any other questions!

 

Regards,


John B.
API Support Specialist
Did I answer your question? If so, please mark my post as an "Accepted Solution" by clicking the Accept as Solution button in the bottom right hand corner of this post.
Resources
Developer Portal

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

Visit Page

Announcements

API Updates

Join our list to be notified of new features and updates to our V3 API.

Sign Up