openid_client icon indicating copy to clipboard operation
openid_client copied to clipboard

How to set token_endpoint_auth_method

Open erik-seifert opened this issue 3 years ago • 1 comments

I must use a hydra enpoint. Getting this error all the time:

Unhandled Exception: OpenIdException(invalid_client): Client authentication failed (e.g., unknown client, no client authentication included, or unsupported authentication method). The OAuth 2.0 Client supports client authentication method 'client_secret_basic', but method 'client_secret_post' was requested. You must configure the OAuth 2.0 client's 'token_endpoint_auth_method' value to accept 'client_secret_post'.

Here an issue on hydra https://github.com/ory/hydra/discussions/2671

erik-seifert avatar Sep 19 '22 12:09 erik-seifert

Any suggestion for me?

erik-seifert avatar Sep 26 '22 21:09 erik-seifert

Hi @erik-seifert ,

I have no experience with hydra. By default, the openid_client discovers the endpoints by doing an http request to $baseIssuerUrl/.well-known/openid-configuration. So, if this does not contain the correct values, there is probably an issue with the hydra configuration. If necessary, when the openid-configuration endpoint does not return correct info, you can also define the issuer metadata as follows:

var issuer = Issuer(OpenIdProviderMetadata.fromJson({
 ...
});

rbellens avatar Dec 29 '22 13:12 rbellens