sijie commented on a change in pull request #6716: [Issue #6711]: add audience 
verify in AuthenticationProviderToken
URL: https://github.com/apache/pulsar/pull/6716#discussion_r407252983
 
 

 ##########
 File path: 
pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authentication/AuthenticationProviderToken.java
 ##########
 @@ -126,9 +137,40 @@ private static String validateToken(final String token) 
throws AuthenticationExc
     @SuppressWarnings("unchecked")
     private Jwt<?, Claims> authenticateToken(final String token) throws 
AuthenticationException {
         try {
-            return Jwts.parser()
+            Jwt<?, Claims> jwt = Jwts.parser()
                     .setSigningKey(validationKey)
                     .parse(token);
+
+            if (audienceClaim != null) {
+                if (audience == null){
 
 Review comment:
   I think the check here should be moved to `initialize` method.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to