You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the issuer is set in the provider metadata, we validate the iss
field of the ID Token against it.
The OpenID Connect Specification says this must always be validated.
But this would be a breaking change for applications configured other
than with ClientRegistrations.fromOidcIssuerLocation(issuer). This will
be done later with #8326fixesgh-8321
Copy file name to clipboardExpand all lines: oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/client/oidc/authentication/OidcIdTokenValidator.java
+7-1
Original file line number
Diff line number
Diff line change
@@ -33,6 +33,7 @@
33
33
importjava.util.HashMap;
34
34
importjava.util.List;
35
35
importjava.util.Map;
36
+
importjava.util.Objects;
36
37
37
38
/**
38
39
* An {@link OAuth2TokenValidator} responsible for
@@ -68,7 +69,12 @@ public OAuth2TokenValidatorResult validate(Jwt idToken) {
68
69
69
70
// 2. The Issuer Identifier for the OpenID Provider (which is typically obtained during Discovery)
70
71
// MUST exactly match the value of the iss (issuer) Claim.
Copy file name to clipboardExpand all lines: oauth2/oauth2-client/src/test/java/org/springframework/security/oauth2/client/oidc/authentication/OidcIdTokenValidatorTests.java
+29
Original file line number
Diff line number
Diff line change
@@ -92,6 +92,35 @@ public void validateWhenIssuerNullThenHasErrors() {
0 commit comments