Developer forum

Forum » Integration » OAuth 2.0 User Impersonation Redirect URL defaulting to HTTP causing error

OAuth 2.0 User Impersonation Redirect URL defaulting to HTTP causing error

Thiago Tedesco
Reply

I have a DW10 site connected to business central and the redirect URL for token acquisition is defaulting to the non secure version, which cannot be added in the redirects in Azure for the application. What could be causing the non-secure version to be used? It was defaulting to the correct https/secure version in the past so I am no sure what changed.

I have tried re-authenticating with no change.


Replies

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Thiago,
that can happen if you are visiting your website without the https, so it looks like you are using the http://staging-xyz.mydwwebsite.com but the redirect url is with https, so try to use the https://staging-xyz.mydwwebsite.com url in the browser.
BR, Dmitrij

 
Thiago Tedesco
Reply

Hi Dimitri, thank you for the quick response.

There is a possibility I or someone else before me may have tried to authenticate to BC for a token visiting the backend using http, however I can't seem to be able to "flush" it, in the attempt above I visited the backend using https.

I am unsure if rebuilding the entire collection from scratch will have any effect. But I may attempt it next if you feel like it would plasibly help.

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply
This post has been marked as an answer

Hi Thiago,
yes, the endpoint authentication token authentication is cached, so you can try to delete the existing endpoint authentication and create a new one with the same parameters or restart the website/application pool and then try to visit the endpoint authentication with the https url for the first time.
BR, Dmitrij

Votes for this answer: 1
 
Thiago Tedesco
Reply

Dimitri, thank you, confirming restarting the app pool and then ensuring I am visiting the backend with https did the trick.

 

You must be logged in to post in the forum