test(oidc): publish a real signing alg in the test JWKS - #4986
Open
rasty94 wants to merge 1 commit into
Open
Conversation
The test key set published "RSA" as both "alg" and "kty". "RSA" is a key type, not a signing algorithm, and the tokens are signed with RS256, so the "alg" was simply wrong. It went unnoticed because go-oidc used to ignore the mismatch. Since v3.20.0 it skips keys whose "alg" it does not recognise instead of failing the whole key set (coreos/go-oidc#491), which leaves the verifier with no usable key and fails every test that verifies an ID token: failed to verify signature: failed to verify id token signature Publishing RS256 as the algorithm and RSA as the key type fixes the fixture and passes on both v3.19.0 and v3.20.0.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The OIDC connector's test key set publishes
"RSA"as bothalgandkty:RSAis a key type, not a signing algorithm, andnewTokensigns withjose.RS256, so the advertisedalgis simply wrong.Why it matters now
go-oidc tolerated the mismatch until v3.20.0, which ignores JWKs with unknown signing algorithms rather than failing. A key advertising
alg: "RSA"is no longer an error — it is silently skipped, which leaves the verifier with no usable key at all:Reproduced on current master with
go get github.com/coreos/go-oidc/v3@v3.20.0. This will land the moment the go-oidc bump does.The change
Publish
RS256as the algorithm andRSAas the key type. Test-only, no production code touched.Verified passing on both go-oidc v3.19.0 (current pin) and v3.20.0.