oidc-wp / openid-connect-generic

WordPress plugin to provide an OpenID Connect Generic client
https://wordpress.org/plugins/daggerhart-openid-connect-generic/
261 stars 153 forks source link

The mandatory 'code_challenge' parameter is missing. #399

Open elfico opened 2 years ago

elfico commented 2 years ago

Describe the bug After configuring all settings, when the login button is clicked, I get the error: error:invalid_request error_description:The mandatory 'code_challenge' parameter is missing. error_uri:https://documentation.openiddict.com/errors/ID2029

Even after removing the PKCE requirement, the error still persists

To Reproduce Steps to reproduce the behavior:

  1. Configure plugin with all necessary parameters.
  2. Try login on the login page.

Expected behavior The login page should be loaded.

Isolating the problem (mark completed items with an [x]):

WordPress Environment

elfico commented 2 years ago

I just realized the issue is because the auth server requires that client must use PKCE. Is there any way to enforce this on the plugin?

timnolte commented 2 years ago

So the plugin doesn't currently support PKCE, this was reported/requested awhile ago. https://github.com/oidc-wp/openid-connect-generic/issues/208

There is a link to an addon that someone developed in the comments on that issue to add PKCE support. I have not validated, nor do we necessarily endorse, that addon but it is a possible solution until we get that built in.

elfico commented 2 years ago

Thanks @timnolte , I would check the plugin. How do I install a plugin though, there seem to be no documentation on installation. Would really appreciate the help. Thanks

timnolte commented 2 years ago

@elfico you can download the required addon file directly from here: https://raw.githubusercontent.com/BeAPI/openid-connect-generic-pkce-addon/main/openid-connect-generic-pkce-addon.php

Once you have that file downloaded you should upload it to your website into the wp-content/mu-plugins directory.