Unable to connect to the server. Please check your network connection

Hello,

I have a Web app that implements the Authorization Code Flow. I was careful to set my redirect url to be the same as defined in “Login redirect URIs” for my app. Also, I’m setting my app to allow both the Authorization Code grant and the Implicit Flow Grant so that I can set “Logon Initiated By” to “Either Okta or App” so that I can optionally logon to my app from Okta.

All is fine when I tried to logon from my Web app. I was redirected to the Okta logon screen. However, after I provided the credentials, instead of being redirected to my landing page on my server, I received the following message:

“Unable to connect to the server. Please check your network connection.”

But I can logon from Okta and get redirected to my landing page on my server successfully, so it seems Okta has no problem connecting to the server and thus it does not appear to be a firewall issue.

Can someone enlighten me on what the problem could be?

Thanks.

This error message is too vague. There is not enough info to work with. Something like a stack trace, Fiddler log, or Chrome debug info would be more helpful.

Thanks for your response and your suggestion to turn on a trace. After turning on Chrome trace, I found out that this is a CORS problem. Apparently the /authorize call and the subsequent logon screen involves cross origin access. After some research, I found that by adding my server’s url as a trusted origin as described in https://developer.okta.com/docs/api/getting_started/enabling_cors, I was able to get redirected to my landing page.

Thanks for feedback. I’d not have guessed it’s CORS.