Skip to content

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