Got a 'How do I' question? Join 'Ask a Trainer' Monday to Friday, 11am to 4pm ET for instant help and pro tips!

Authorization and Redirect URL v3

ThomasB865
Rookie
0 Votes

Let me begin by explaining what I'm trying to accomplish.

Using Delphi 10.2 to compile.

We have a windows desktop program (not a web based app) that uses browser emulation for IE7 through IE11 depending on what version of windows the person is running. We don't need to display a page with the redirect URL, we just get the Authorization Code after clicking 'allow' and then hit the token exchange endpoint.

This method works for a couple other integrations so I'm not trying to get new code to work. The main issue is nothing happens when I click 'allow'. Here's the log of each page request and completion that I see through the TWebBrowser.

 

Signing In:
11/7/2019 11:48:05 AM: Before Navigation - https://login.constantcontact.com/login/login.sdo
11/7/2019 11:48:06 AM: Completed Navigation - https://idfed.constantcontact.com/as/Am6XvWBimo/resume/as/authorization.ping?resume=/as/Am6XvWBimo/r...

 

And here's where I click 'allow'. The page never completes navigation. I actually click it twice. I think it's trying to do something with the resume but can't seem to complete the navigation.


11/7/2019 11:48:08 AM: Before Navigation - https://idfed.constantcontact.com/as/Am6XvWBimo/resume/as/authorization.ping
11/7/2019 11:48:08 AM: Before Navigation - javascript:void(0)
11/7/2019 11:48:12 AM: Before Navigation - https://idfed.constantcontact.com/as/Am6XvWBimo/resume/as/authorization.ping
11/7/2019 11:48:12 AM: Before Navigation - javascript:void(0)

 

Let me know if anything obvious sticks out here, or if you've seen anything like this in the past!

6 REPLIES 6
Jimmy_D
Employee
0 Votes

Hello @ThomasB865,

 

Thank you for reaching out to Constant Contact's API Support.

 

Are you attempting to use the server flow or the client flow?


Regards,
Jimmy D.
Tier II API Support Engineer
ThomasB865
Rookie
0 Votes

Your question has helped me,

I was attempting the server flow so that I could refresh the token for the user, but I switched  to Client Flow instead and was able to get a bearer token.

I do get a javascript error on the tbevents.js file.

11/7/2019 2:20:18 PM: Script error.
11/7/2019 2:20:18 PM: https://connect.facebook.net/en_US/fbevents.js

But it seem's the client flow has been more forgiving, and that js file isn't required to gain a token.Thanks for the nudge!

SilviaG20
Marketing Expert

hello . I used the server flow but your response is always 

{"error_description":"Authorization code is invalid or expired.","error":"invalid_grant"}

im sure the Authorization code is correct

i have attempted many times

 

Jimmy_D
Employee
0 Votes

Hi @SilviaG20,

 

The authorization code from Step 3 expires after 60 seconds; are going able to move from Step 3 to Step 4 quickly enough for the code to not expire?


Regards,
Jimmy D.
Tier II API Support Engineer
raleighb3
Marketing Legend
0 Votes

I will start a new thread if you'd like.  Just let me know.   But my issue is the very same as in the original post.  This is also a Windows application, using a webBrowser control.   Doing the 'server' flow.  When "Allow" is clicked, it appears that nothing is getting triggered. Browser remains on the Allow/Deny page.

 

From log--->

WebBrowser1_Navigated
https://idfed.constantcontact.com/as/jkr4A9muH2/resume/as/authorization.ping?resume=/as/jkr4A9muH2/r...
WebBrowser1_DocumentCompleted
https://idfed.constantcontact.com/as/jkr4A9muH2/resume/as/authorization.ping?resume=/as/jkr4A9muH2/r...
WebBrowser1_Navigating
https://idfed.constantcontact.com/as/jkr4A9muH2/resume/as/authorization.ping
WebBrowser1_Navigating
javascript:void(0)
WebBrowser1_Navigating
https://idfed.constantcontact.com/as/jkr4A9muH2/resume/as/authorization.ping
WebBrowser1_Navigating
javascript:void(0)

 

user3707934
Rookie
0 Votes

The Document Completed event indicates that the web page has finished loading. However, in some cases, the Document Completed event might be triggered before JavaScript execution is complete. Try using the WebBrowser1_ Navigating event instead to monitor the navigation progress and see if the Navigating event fires multiple times for the same URL?

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