hazmat345 commented on code in PR #9566:
URL: https://github.com/apache/nifi/pull/9566#discussion_r1881111982
##########
nifi-registry/nifi-registry-core/nifi-registry-web-api/src/main/java/org/apache/nifi/registry/web/security/authentication/jwt/JwtIdentityProvider.java:
##########
@@ -70,7 +71,8 @@ public AuthenticationResponse
authenticate(AuthenticationRequest authenticationR
try {
final String jwtPrincipal =
jwtService.getUserIdentityFromToken(jwtAuthToken);
- return new AuthenticationResponse(jwtPrincipal, jwtPrincipal,
expiration, issuer);
+ final Set<String> groups =
jwtService.getUserGroupsFromToken(jwtAuthToken);
Review Comment:
Refactored to improve the efficiency of token parsing / validation. I did
change the method signature of a couple public methods - if you'd rather me not
do that just let me know and I'll just add new methods instead of replacing the
existing ones.
##########
nifi-registry/nifi-registry-core/nifi-registry-web-api/src/main/java/org/apache/nifi/registry/web/security/authentication/jwt/JwtService.java:
##########
@@ -82,6 +85,27 @@ public String getUserIdentityFromToken(final String
base64EncodedToken) throws J
}
}
+ public Set<String> getUserGroupsFromToken(final String base64EncodedToken)
throws JwtException {
Review Comment:
Refactored to improve the efficiency of token parsing / validation. I did
change the method signature of a couple public methods - if you'd rather me not
do that just let me know and I'll just add new methods instead of replacing the
existing ones.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]