Skip to content
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

Client authentication failed when requesting tokens #464

Open
gweinfurther opened this issue Mar 6, 2025 · 0 comments
Open

Client authentication failed when requesting tokens #464

gweinfurther opened this issue Mar 6, 2025 · 0 comments

Comments

@gweinfurther
Copy link

I am using a PKCE flow. I am successfully getting an authentication code from the OP but I get PHP errors from this library when it requests tokens.

As reported in another issue, requestTokens performs a urlencode() on $this->clientSecret, which happens to be NULL in my case. The OP does not support client secret.

So I tried changing the requestTokens function to this:

# Consider Basic authentication if provider config is set this way
if (!empty($this->clientSecret) && $this->supportsAuthMethod('client_secret_basic', $token_endpoint_auth_methods_supported)) {

Now I am not getting any more PHP errors but the OP is returning the error "invalid client" and error message "Client authentication failed" in its response to the token request.

Is this an issue with the OP? If so, why did I get a successful authentication code?

Am I missing something? Here's my code:

$oidc = new OpenIDConnectClient(
	$url,
	$clientId
);

$oidc->setCodeChallengeMethod('S256');

if ($oidc->authenticate())
{
  ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant