kumaab commented on code in PR #901:
URL: https://github.com/apache/ranger/pull/901#discussion_r3018121320
##########
ranger-authn/src/main/java/org/apache/ranger/authz/handler/jwt/RangerJwtAuthHandler.java:
##########
@@ -290,6 +303,38 @@ protected boolean validateAudiences(final SignedJWT
jwtToken) {
return valid;
}
+ /**
+ * Validate whether any of the accepted issuer claims is present in the
issued
+ * token claims list for issuer. Override this method in subclasses in
order
+ * to customize the audience validation behavior.
+ *
+ * @param jwtToken the JWT token from which the JWT issuer will be obtained
+ * @return true if an expected issuer is present, otherwise false
+ */
+ protected boolean validateIssuer(final SignedJWT jwtToken) {
Review Comment:
Multi-issuer support is a good follow-up (in another PR). For this PR, I
suggest to scope it for single-issuer validation. Multi-issuer support would
require issuer-specific config and processor selection, something like:
```
jwt.issuers=issuerA,issuerB
jwt.issuer.issuerA.iss=https://idp-a/...
jwt.issuer.issuerA.jwks-url=...
jwt.issuer.issuerA.audiences=...
jwt.issuer.issuerB.iss=https://idp-b/...
jwt.issuer.issuerB.jwks-url=...
jwt.issuer.issuerB.audiences=...
```
so it would be better handled in a separate PR.
--
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]