Regular Web Application

I have done the quick start for “regular web application” - I guess I started wrong with Single page application. Anyway I am tryign to find out on the “callback URL” What I look at that says the user has logged in or failure or what. My cgi file is being called - I had tried to write env variables, etc… to a file and nothing I have tried is giving me the logged in email address or logged in user.
What am I missing ?


Hi @jerry.geis,

What framework are you using?

Have you looked at the corresponding Quickstart?

Can you give us the full error you are seeing?

Hi I have looked at hte quickstart… I am using the “regular web app” and Apache.

I tried taking the return value from the cookie and using curl to get the info but it gives an error.


curl --request POST
–url ‘https://mydomain/oauth/token
–header ‘content-type: application/x-www-form-urlencoded’
–data grant_type=authorization_code
–data ‘client_id=wc1pVURzQdma16HGZHFli7wjYRandGGZ’
–data client_secret=MuqyI4vClx3Hpg2ncq7CuwWiF_yQPMZfzxNxJ7EdP57GTlz_eh08uukDo_5BvUo0
–data code=$mod_auth_openidc_session
–data ‘redirect_uri=https:://myip/callback’

{“error”:“invalid_grant”,“error_description”:“Invalid authorization code”}


You should receive a code with the callback, that is what will be sent with the token request.

Here is an example:

HI Dan - I was using the wrong code. I am now seeing this:
/~silentm/bin/auth0.cgi?code=T6GnOwre1jAYe9u_&state=xcATxc75EGM6ZoztXqskhHbVrM8 HTTP/1.1" 302

So take that CODE and run a script:
curl --request POST --url --header ‘content-type: application/x-www-form-urlencoded’ --data grant_type=authorization_code --data client_id=wc1pVURzQdma16HGZHFli7wjYRandGGZ --data client_secret=MuqyI4vClx3Hpg2ncq7CuwWiF_yQPMZfzxNxJ7EdP57GTlz_eh08uukDo_5BvUo0 --data code=T6GnOwre1jAYe9u_ --data redirect_uri=https://MyServer/~silentm/bin/auth0.cgi

{“error”:“invalid_grant”,“error_description”:“Invalid authorization code”}

What am I doing wrong ? I take the return code - send it back and get an error ?


That error is saying that the code that you have provided is invalid for some reason. It isn’t very descriptive, so I can only try to guess what is causing it. Are you waiting a long time before you pass the code you received? Is it possible you are reusing the code at some point?