About EasyMorph Tutorials & Examples Web-help

OAuth2 - obtain the authorization code/security token automatically

Hello,

I have a question regarding obtaining the authorization code (and therefore the security token) automatically, in my case I have to paste it manually here:

When I log in to my app in the browser, I get the callback URL with the authorization code (which works if I copy and paste it manually), so I was wondering what could be possible causes for it not working automatically.

Thanks,

Roberto

Hi @roberto.

Scenario A.
Let’s say OAuth2 Redirect URI have been set to a generic url like [scheme]://[host]:[port][/path] (eg. http://localhost:12345/auth) .
It should work automatically only when all conditions are met.

  1. Specified host in the Redirect URI have been set to localhost or 127.0.0.1.
  2. Specified port in the Redirect URI was not occupied by any other app.
  3. http schema used.
  4. EasyMorph was able to open specified port on localhost and start http listener.
  5. External OAuth2 Site performs automatic redirect to the specified Redirect URI.
  6. External OAuth2 Site supports Authorization Code Flow.

Scenario B.
Redirect URI have been set to urn:ietf:wg:oauth:2.0:oob or other value.
In such case you should copy and paste authorization code manually.

To learn more about EasyMorph visit easymorph.com.