Skip to content

Why is the 'alg' parameter required? #498

Closed
@SamMousa

Description

@SamMousa

In 6.0 a change was introduced that made alg required when parsing keys.

At the time someone already noted that it was a breaking change: #376 (comment)

This is a breaking change that is currently not obvious from the 6.0 release notes.
As a notable example, Microsoft do not output JWK with the alg key populated:
https://login.microsoftonline.com/common/discovery/keys
I think the release notes should encourage developers to inspect JWK::parseKeySet beyond just its return type.
Thanks!

The solution was implemented in #426 where a default algorithm value could be set.

As far as I can tell no motivation for making this algorithm a required parameter was given. I'm working on an OIDC implementation and to me this feels like a very brittle approach, given that:

This means that in advance I cannot know what default algorithm to use. Sure, I could check the JWKS contents or the tokens I receive and see that it is RS256 today, but the whole point of this approach to configuration is that the other party can change it whenever they want. This means if Microsoft decides to switch to RS384, my production code will break.

Could you elaborate on why this requirement, which as is mentioned in the source code, is stricter than the spec was added?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions