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

OIDC JWK endpoint expects application/jwk-set+json but only gets accept application/json (406 Not Acceptable) #466

Closed
2 tasks done
frederik opened this issue Feb 3, 2022 · 1 comment

Comments

@frederik
Copy link
Contributor

frederik commented Feb 3, 2022

Describe the bug

The jwk endpoint to retrieve the JWK sets seems to usually accept application/json as an accept header.
However, some OIDC provider implementations explicitly expect Accept: 'application/jwk-set+json' (which is valid for JWKS according to the spec). As a result they send back a 406 Not Acceptable.

Other libraries seem to have added this header, see Tomcat OIDC auth and others.

I do not have access to a public endpoint with this behavior, but would be able to verify once the header is added.

Expected behaviour

Setting the headers to Accept: 'application/json, application/jwk-set+json'
results in a successful request.

The line responsible is the GET request in function getKeyStore (lib/helpers/issuer.js). The following headers result in a successful request

headers: {
    Accept: 'application/json, application/jwk-set+json',
}

I'd be happy to submit a pull request, if this is accepted as a bug.

Environment:

  • openid-client version: 5.1.1
  • node version: 16.13.1

Additional context
Add any other context about the problem here.

  • the bug is happening on latest openid-client too.
  • i have searched the issues tracker on github for similar issues and couldn't find anything related.

Thanks for this great library and the work you put into it 😃 !

@frederik frederik added the triage label Feb 3, 2022
@panva
Copy link
Owner

panva commented Feb 3, 2022

Feel free to open a PR, I'll have a look at it!

@panva panva closed this as completed in f94d42b Feb 3, 2022
@github-actions github-actions bot locked and limited conversation to collaborators May 5, 2022
@panva panva removed the triage label Oct 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants