Skip to content

Commit

Permalink
Implement review suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
lordvlad committed Jul 11, 2023
1 parent 898d378 commit 1ed52a0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ public static class Jwt {
* Additional `scope` added to JWT claims.
*/
@ConfigItem
public Optional<Set<String>> scope = Optional.empty();
public Optional<Set<String>> scopes = Optional.empty();

/**
* JWT life-span in seconds. It will be added to the time it was issued at to calculate the expiration time.
Expand Down Expand Up @@ -375,12 +375,12 @@ public void setKeyFile(String keyFile) {
this.keyFile = Optional.of(keyFile);
}

public Optional<Set<String>> getScope() {
return scope;
public Optional<Set<String>> getScopes() {
return scopes;
}

public void setScope(Set<String> scope) {
this.scope = Optional.of(scope);
public void setScopes(Set<String> scopes) {
this.scopes = Optional.of(scopes);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,10 +352,10 @@ public static String signJwtWithKey(OidcCommonConfig oidcConfig, String tokenReq
? removeLastPathSeparator(oidcConfig.credentials.jwt.getAudience().get())
: tokenRequestUri)
.expiresIn(oidcConfig.credentials.jwt.lifespan);

oidcConfig.credentials.jwt.scope.ifPresent((scope) -> {
claimsBuilder.claim("scope", String.join(",", scope));
});
if (oidcConfig.credentials.jwt.scopes.isPresent()) {
claimsBuilder.claim(OidcConstants.TOKEN_SCOPE, String.join(",", oidcConfig.credentials.jwt.scopes.get()))
}

JwtSignatureBuilder builder = claimsBuilder.jws();

Expand Down

0 comments on commit 1ed52a0

Please sign in to comment.