Skip to content

Key id must match in all circumstances #33

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

selfsimilar
Copy link
Contributor

@selfsimilar selfsimilar commented Mar 1, 2024

Previously, the jwks() function in ProviderController.php would return a default kid value if the $crypt->kid value was null. This could be seen in the output of .well-known/jwks.json which would return

{"keys":
[{"alg":"RS256","kty":"RSA","use":"sig","kid":1,"n":"abced..."
}]}

This had two problems. Firstly, the kid needs a string value, not a numeric. Secondly, the user token issued by the POST /oauth/token route would have a kid value of null. Therefore, no clients could match the key needed to decode the JWT.

This fix allows for the kid to be set via the KeyRepository methods if necessary, and by default sets a default string kid value for the returned CryptKey object.

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

Successfully merging this pull request may close these issues.

1 participant