Skip to content

Commit 8d470f0

Browse files
committed
implement equals and hashCode in OidcIdToken
Closes: #15156 Signed-off-by: Andrey Litvitski <[email protected]>
1 parent d8043dc commit 8d470f0

File tree

1 file changed

+17
-0
lines changed
  • oauth2/oauth2-core/src/main/java/org/springframework/security/oauth2/core/oidc

1 file changed

+17
-0
lines changed

oauth2/oauth2-core/src/main/java/org/springframework/security/oauth2/core/oidc/OidcIdToken.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,23 @@ public Map<String, Object> getClaims() {
7373
return this.claims;
7474
}
7575

76+
@Override
77+
public boolean equals(Object obj) {
78+
if (this == obj) {
79+
return true;
80+
}
81+
if (obj == null || this.getClass() != obj.getClass()) {
82+
return false;
83+
}
84+
OidcIdToken that = (OidcIdToken) obj;
85+
return this.getClaims().equals(that.getClaims());
86+
}
87+
88+
@Override
89+
public int hashCode() {
90+
return this.getClaims().hashCode();
91+
}
92+
7693
/**
7794
* Create a {@link Builder} based on the given token value
7895
* @param tokenValue the token value to use

0 commit comments

Comments
 (0)