[keycloak-user] Facebook - invalid_grant and "Code not valid"

Виталий Ищенко betalb at gmail.com
Fri Dec 15 00:02:51 EST 2017


I think you need to check redirect url that is posted by keycloak when
you've been redirected back to drupal
And enable debug logging on drupal plugin side

Code that is posted by drupal must match

POST https://api.authorization-server.com/token
  grant_type=authorization_code&
  code=AUTH_CODE_HERE&
  redirect_uri=REDIRECT_URI&
  client_id=CLIENT_ID&
  client_secret=CLIENT_SECRET


Also, check KeyCloak logs, they might give you some insights

ср, 13 дек. 2017 г. в 6:11, Anton <kurrent93 at gmail.com>:

> Hello
>
> We are using KC with Facebook.
>
> This is working fine when we integrate this into our mobile app.
>
> However, on our website (drupal, using
> https://www.drupal.org/project/openid_connect) we get the following error
> (in drupal):
>
>
> Could not retrieve tokens. Details: Client error: `POST
> https://
> <url-to-keycloak>/auth/realms/myrealm/protocol/openid-connect/token`
> resulted in a `400 Bad Request` response:
> {"error":"invalid_grant","error_description":"Code not valid"}
>
>
> Does anyone know what might be causing this?
>
> Thanks
> _______________________________________________
> keycloak-user mailing list
> keycloak-user at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/keycloak-user
>


More information about the keycloak-user mailing list