nodece opened a new pull request, #23798: URL: https://github.com/apache/pulsar/pull/23798
### Motivation When the pulsar-admin CLI uses the kerberos authentication with tls transport, we encounter the following issue: ``` $ bin/pulsar-admin tenants list 2024-12-31T15:35:56,308+0800 [main] INFO org.apache.pulsar.client.impl.auth.AuthenticationSasl - JAAS loginContext is: PulsarClient. 2024-12-31T15:35:56,455+0800 [main] INFO org.apache.pulsar.common.sasl.JAASCredentialsContainer - successfully logged in. 2024-12-31T15:35:56,459+0800 [pulsar-tgt-refresh-thread] INFO org.apache.pulsar.common.sasl.TGTRefreshThread - TGT refresh thread started. 2024-12-31T15:35:56,463+0800 [pulsar-tgt-refresh-thread] INFO org.apache.pulsar.common.sasl.TGTRefreshThread - Client principal is "client/[email protected]". 2024-12-31T15:35:56,463+0800 [pulsar-tgt-refresh-thread] INFO org.apache.pulsar.common.sasl.TGTRefreshThread - Server principal is "krbtgt/[email protected]". 2024-12-31T15:35:56,483+0800 [pulsar-tgt-refresh-thread] INFO org.apache.pulsar.common.sasl.TGTRefreshThread - TGT valid starting at: Tue Dec 31 15:35:56 CST 2024 2024-12-31T15:35:56,484+0800 [pulsar-tgt-refresh-thread] INFO org.apache.pulsar.common.sasl.TGTRefreshThread - TGT expires: Wed Jan 01 15:35:56 CST 2025 2024-12-31T15:35:56,484+0800 [pulsar-tgt-refresh-thread] INFO org.apache.pulsar.common.sasl.TGTRefreshThread - TGT refresh sleeping until: Wed Jan 01 11:38:40 CST 2025 class org.apache.pulsar.client.api.PulsarClientException$UnsupportedAuthenticationException: Method not implemented! ``` `Authentication` providers two methods to get the authentication data: - `org.apache.pulsar.client.api.Authentication#getAuthData(java.lang.String)` - For compatibility, which will call `org.apache.pulsar.client.api.Authentication#getAuthData()` - `org.apache.pulsar.client.api.Authentication#getAuthData()` However, the client/admin/broker/proxy still call the `org.apache.pulsar.client.api.Authentication#getAuthData()`, this breaks the kerberos authentication. ### Modifications - Use `org.apache.pulsar.client.impl.auth.AuthenticationSasl#getAuthData(java.lang.String)` instead of `org.apache.pulsar.client.api.Authentication#getAuthData()`. ### Documentation <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. --> - [ ] `doc` <!-- Your PR contains doc changes. --> - [ ] `doc-required` <!-- Your PR changes impact docs and you will update later --> - [x] `doc-not-needed` <!-- Your PR changes do not impact docs --> - [ ] `doc-complete` <!-- Docs have been already added --> -- 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]
