Validity of Authorization Code

Skip to first unread message

Amal Antony

Oct 19, 2022, 4:04:03 AM10/19/22
to Keycloak Dev

I want to know how long is the authorization code valid for getting Keycloak's access token. Is there any time limit for it or Is it for one time usage only.

Suppose we use the authorization code for getting an access token but the flow was not completed properly and resulted in failure. Can the same code be used again to get the access token. Will it result in success or will it show a failure message like "code not valid"?
It showed the error message when I tried it using Postman. I just wanted to confirm on this.

Amal Antony

Michal Hajas

Oct 19, 2022, 5:01:01 AM10/19/22
to Amal Antony, Keycloak Dev
Hello Amal,

I believe this kind of question belongs to the keycloak-user group rather than keycloak-dev. Could you please use it for the following questions? See for more details.

To your question:
Yes, it should result in the message "code not valid". Authorization code is valid only for a very limited amount of time.

See the following for more details on authorization code flow:


You received this message because you are subscribed to the Google Groups "Keycloak Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit
Reply all
Reply to author
0 new messages