You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/05/03 10:33:22 UTC

[GitHub] [pulsar] liudezhi2098 commented on a diff in pull request #15121: [Authenticate] fix Invalid signature error when use Kerberos Authentication

liudezhi2098 commented on code in PR #15121:
URL: https://github.com/apache/pulsar/pull/15121#discussion_r863651392


##########
pulsar-broker-auth-sasl/src/main/java/org/apache/pulsar/broker/authentication/AuthenticationProviderSasl.java:
##########
@@ -98,8 +102,14 @@ public void initialize(ServiceConfiguration config) throws IOException {
                 throw new IOException(e);
             }
         }
-
-        this.signer = new SaslRoleTokenSigner(Long.toString(new Random().nextLong()).getBytes());
+        String saslJaasServerRoleTokenSignerSecretFile = config.getSaslJaasServerRoleTokenSignerSecret();
+        byte[] secret = null;
+        if (StringUtils.isNotBlank(saslJaasServerRoleTokenSignerSecretFile)) {
+            secret = readSecretFromUrl(saslJaasServerRoleTokenSignerSecretFile);
+        } else {
+            secret = SaslConstants.JAAS_DEFAULT_ROLE_TOKEN_SIGNER_SECRET.getBytes();

Review Comment:
   I agree fail on startup if the value is null while authentication is enabled for SASL.



-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org