# Code not valid with authorization\_code as grant type

**URL:** <https://forum.keycloak.org/t/code-not-valid-with-authorization-code-as-grant-type/26423>\
**Category:** Getting advice\
**Tags:** authentication\
**Created:** [June 10, 2024, 2:31pm UTC](https://forum.keycloak.org/t/code-not-valid-with-authorization-code-as-grant-type/26423 "2024-06-10T14:31:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Venkat](https://avatars.discourse-cdn.com/v4/letter/v/4491bb/32.png) [@Venkat](https://forum.keycloak.org/u/Venkat)\
**Post date:** [June 10, 2024, 2:31pm UTC](https://forum.keycloak.org/t/code-not-valid-with-authorization-code-as-grant-type/26423/1 "2024-06-10T14:31:11Z")

</div>

Hello All,  
I am getting error “code not valid” with authorization\_code as grant type. I am trying to exchange code for access token. Can anyone please help.  
Is there any way to skip the token exchange and get directly the access token from keycloak ?

{  
“error”: “invalid\_grant”,  
“error\_description”: “Code not valid”  
}
