openid-connect-generic icon indicating copy to clipboard operation
openid-connect-generic copied to clipboard

ERROR: Invalid token response

Open joaocg opened this issue 5 years ago • 14 comments

Sorry for my ignorance! I'm getting the error message below:

ERROR: Invalid token response

Is there any specific settings I need to make in the plugin? Or what do I have to do on openid?

joaocg avatar Jul 18 '18 13:07 joaocg

I am facing this same problem. Did you solve it? logs

tolstenko avatar Aug 10 '18 18:08 tolstenko

Me too!

timhampton avatar Sep 26 '18 01:09 timhampton

The response from your identity provider is missing the id_token, which is required by the Open ID Connect specification. Your identity provider does not seem to implement Open ID Connect?

https://openid.net/specs/openid-connect-core-1_0.html#TokenResponse

mvarblow avatar Sep 27 '18 14:09 mvarblow

I had the same problem and it helped to add "openid" as a scope in the plugins settings. I'm using the plugin in combination with Keycloak, if that matters.

mrm1st3r avatar Oct 01 '18 09:10 mrm1st3r

I have the same issue, and adding 'openid' to the plugin's scope did not fix it. Is there anything else that I should consider? (I've followed this guide to setup keycloak and the openid-connect plugin) https://westergaard.eu/2018/05/sso-lets-talk-about-single-sign-on-for-wordpress-and-gitlab-using-keycloak-redhat-sso-featuring-special-guest-duo-security-for-2fa/

thedulus avatar Nov 12 '18 20:11 thedulus

Did anyone find a solution?

joaocg avatar Jan 08 '19 14:01 joaocg

@joaocg Adding openid to the scope worked for me. Keycloak 2+ no longer sends the id_token unless the openid scope is specified. It did give me the same error when attempting to login from the screen it drops you on when you get the error -- it worked once I left and went through a normal login flow.

Well, when I say worked, got further -- the defaults for Display Name Formatting didn't match up with what Keycloak sends, leading me to another issue - https://github.com/daggerhart/openid-connect-generic/issues/91 to which I got working. Now all is good!

CharlyRipp avatar Jan 26 '19 02:01 CharlyRipp

With regards to the openid scope, this is a required scope in order to use Open ID Connect. If you are intending to use Open ID Connect, you MUST have this scope in your list. It may not solve all problems above but should be included regardless.

gnompsky avatar Oct 08 '19 13:10 gnompsky

Can anyone help me with the this? I can't seem to get passed the code not valid error after logging in with keycloak. image image image

image

image

cescarsega avatar Apr 06 '20 23:04 cescarsega

I had the same problem and it helped to add "openid" as a scope in the plugins settings. I'm using the plugin in combination with Keycloak, if that matters.

this approach worked for me. After saved the settings when I tried for the first time it failed but it started to work from second request :)

aupr avatar Jun 28 '20 08:06 aupr

I'm facing the same issue. I'm trying to use Nextcloud as login server, it worked using the MiniOrange Plugin, but that plugin is giving me truble with another plugin. I already disabled refresh token, but no success, already tried using openid scope, but Nextcloud doesn't support scope (could this be the problem?) I really need this to work, could anyone give me some hint?

lucasmkrolow avatar Nov 16 '20 13:11 lucasmkrolow

@lucasmkrolow does Next loud actually support the OpenID Connect standard. Mini Orange also provides solutions for SAML which is not the same thing as OpenID Connect. Can you provide a list of the configuration parameters that are available in NextCloud and what OpenID Connect configuration documentation for NextCloud that you are using?

timnolte avatar Nov 16 '20 23:11 timnolte

Nextcloud uses OAuth 2.0 (that might be the problem). When I create a client there (with Name and Redirect URI) they give me the Client ID and the Secret Key, which I enter in the config page, along with the following URLs: Authorization endpoint: https://cloud.example.org/apps/oauth2/authorize Token endpoint: https://cloud.example.org/apps/oauth2/api/v1/token User info endpoint: https://cloud.modularat.com.br/ocs/v2.php/cloud/user?format=json I just don't have a Logout URL. For Identity key I use: ocs.data.id (the same as MO plugin used) Also I'm not pretty sure about what to enter in Nickname Key, Email Formatting and Display Name Formatting.

lucasmkrolow avatar Nov 17 '20 15:11 lucasmkrolow

Just add openid to scope Auth0 OpenId Connect Scope Reference Page As you can see you should add openid as a scope openid (required; to indicate that the application intends to use OIDC to verify the user's identity)

isikhi avatar Dec 07 '20 11:12 isikhi