Auth0 Home Blog Docs

Generate Authorization Code Programatically




I need to implement the authorization code flow in my application, but without using auth0’s lock. Users start the interaction on a 3rd party website and will authenticate with auth0 in my website but using our own UI, which we already got it working. From there I need to be able to generate an authorization code programatically, and then redirect the users back to the 3rd party URL having the auth code as a parameter.

Basically what I need is to be able to generate an auth code without using the lock.

I’ve spent quite a few time reading the documentation and going through the PHP SDK’s code, but couldn’t find anything I could use.

Have you guys ever had a similar issue to this?

Another thing that could work in my case is the ability to use an access_token to retrieve an authorization code (kind of the opposite way).

Please let me know of anything that could help me.



Since no one has replied to this, I’m assuming at this point that is not possible.