Revert "Provide fix for Google iss claim"
This reverts commit b6212cba66
.
This commit is contained in:
parent
e31684bcf5
commit
9133eb1b78
|
@ -44,27 +44,11 @@ public class IdToken extends SecurityToken implements IdTokenClaimAccessor {
|
||||||
public IdToken(String tokenValue, Instant issuedAt, Instant expiresAt, Map<String, Object> claims) {
|
public IdToken(String tokenValue, Instant issuedAt, Instant expiresAt, Map<String, Object> claims) {
|
||||||
super(tokenValue, issuedAt, expiresAt);
|
super(tokenValue, issuedAt, expiresAt);
|
||||||
Assert.notEmpty(claims, "claims cannot be empty");
|
Assert.notEmpty(claims, "claims cannot be empty");
|
||||||
this.claims = Collections.unmodifiableMap(new LinkedHashMap<>(this.sanitize(claims)));
|
this.claims = Collections.unmodifiableMap(new LinkedHashMap<>(claims));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> getClaims() {
|
public Map<String, Object> getClaims() {
|
||||||
return this.claims;
|
return this.claims;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Map<String, Object> sanitize(Map<String, Object> claims) {
|
|
||||||
// NOTE:
|
|
||||||
// Google's OpenID Connect implementation issues ID Tokens
|
|
||||||
// that omit the required https:// scheme prefix from the iss claim.
|
|
||||||
// This method will apply the required scheme prefix as a temporary workaround
|
|
||||||
// until Google's OpenID Connect implementation is updated.
|
|
||||||
// See http://openid.net/specs/openid-connect-core-1_0.html#GoogleIss
|
|
||||||
|
|
||||||
String iss = (String)claims.get(IdTokenClaim.ISS);
|
|
||||||
if (!iss.startsWith("https://")) {
|
|
||||||
claims = new LinkedHashMap<>(claims);
|
|
||||||
claims.put(IdTokenClaim.ISS, "https://" + iss);
|
|
||||||
}
|
|
||||||
return claims;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue