izumo27 commented on code in PR #25538:
URL: https://github.com/apache/pulsar/pull/25538#discussion_r3102467055


##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/auth/oauth2/protocol/TokenClient.java:
##########
@@ -53,13 +53,16 @@ public void close() throws Exception {
      * Constructing http request parameters.
      *
      * @param req object with relevant request parameters
+     * @param includeSecret whether to include client_secret in the request 
body
      * @return Generate the final request body from a map.
      */
-    String buildClientCredentialsBody(ClientCredentialsExchangeRequest req) {
+    String buildClientCredentialsBody(ClientCredentialsExchangeRequest req, 
boolean includeSecret) {
         Map<String, String> bodyMap = new TreeMap<>();
         bodyMap.put("grant_type", "client_credentials");
         bodyMap.put("client_id", req.getClientId());
-        bodyMap.put("client_secret", req.getClientSecret());
+        if (includeSecret) {
+            bodyMap.put("client_secret", req.getClientSecret());
+        }
         // Only set audience and scope if they are non-empty.

Review Comment:
   I added `TokenEndpointAuthMethod` for `client_secret_post` and 
`tls_client_auth`



-- 
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]

Reply via email to