Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge 3.0.2 into main #359

Merged
merged 11 commits into from
Jun 6, 2023
Prev Previous commit
Next Next commit
Add guard for empty claims set in open id.
Signed-off-by: Arjan Tijms <[email protected]>
arjantijms committed Jan 24, 2023
commit e0856ccfaaf45f845def8cd8bfdb880cfabe5bd4
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Contributors to the Eclipse Foundation
* Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -61,7 +61,7 @@ public AccessTokenImpl(String tokenType, String token, Long expiresIn, String sc
try {
this.tokenJWT = JWTParser.parse(token);
jwtClaimsSet = tokenJWT.getJWTClaimsSet();
this.claims = jwtClaimsSet.getClaims();
this.claims = ifPresent(jwtClaimsSet);
} catch (ParseException ex) {
// Access token doesn't need to be JWT at all
}
@@ -72,7 +72,7 @@ public AccessTokenImpl(String tokenType, String token, Long expiresIn, String sc
this.createdAt = System.currentTimeMillis();
this.scope = Scope.parse(scopeValue);
}

@Override
public boolean isExpired() {
boolean expired;
@@ -138,5 +138,9 @@ public JwtClaims getJwtClaims() {
public String toString() {
return token;
}

private Map<String, Object> ifPresent(JWTClaimsSet claimsSet) {
return claimsSet == null ? null : claimsSet.getClaims();
}

}