-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
_codexch uses default Client ID / Secret #44
Comments
Here is the relevant line from the error log 2021/12/08 16:29:25 [error] 21314#21314: *2 js: OIDC error from IdP when sending authorization code: invalid_client, Client authentication failed (e.g. unknown client, no client authentication included, or unsupported authentication method). The authorization server MAY return an HTTP 401 (Unauthorized) status code to indicate which HTTP authentication schemes are supported. If the client attempted to authenticate via the Authorization request header field, the authorization server MUST respond with an HTTP 401 (Unauthorized) status code, and include the WWW-Authenticate response header field matching the authentication scheme used by the client. Check your client authentication settings. |
Hi @lcrilly, Thank for the response Yes, but from the request above, it is sending the wrong Client ID and Secret (the default Client ID and Secret wasn't sanitized in my logs, only the hostnames and actual Client ID/Secret) to my IDP
This seems to be from the default mappings
The logs on my IDP side is also showing the invalid client id
|
Hi @wongkeewee , thanks for reporting that issue in that detail! That definitely helped us to investigate the issue. As the variable value assigned by a Before the subrequest:
After the subrequest to
As you can see, the value of your client-id had been changed as the value of I have created a small fix for this problem but need to test it or kindly ask you to give it a try. The solution is, we have to make sure the
As you can see, I have just introduced another variable
Let me know if this works for you. |
Hi @tippexs, Thanks for the response! Finally got a chance to test this out after the meltdown for past couple of days. I've configured the
However, the _codexch is still throwing the same error and the IDP is still seeing Did I apply the configuration in the correct place, ie |
Hi @tippexs, I have configured the $ruri variable in our conf file, but the $ruri is still picking up the current URI and not mapping to the correct configuration. Is there a specific location i need to place the |
The |
Hi @tippexs, I have configured
The debug logs are shared here https://drive.google.com/file/d/18g1K44cQeiAO50E4pOFsxBNl5v4rts7T/view?usp=sharing It looks like the URI are not persisted across the OIDC call
|
Hi @tippexs, Are you able to advise based on the logs provided? |
Hi,
I have a requirement to protect different URI on the same reverse proxy with different set of Client ID/Secret and Scopes, for example:
I followed Issue #27 to map using $uri instead of $host
openid_connect_configuration.conf
When I access the protected URI, I am prompted to login at my SSO server and redirected back to the callback URI _codexch.
However, the _codexch throws a
NGINX / OpenID Connect login failure
error.From the SSO server, I am seeing that the OIDC is attempting to authenticate with
my-client-id
andmy-client-secret
, which is the default value in theopenid_connect_configuration.conf
file.It seems like it is not picking up the Client ID/Secret for the URI.
The debug output of nginx is:
Nginx Version
Any idea if I missed out on any any configuration for URI?
The text was updated successfully, but these errors were encountered: