Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-15077

FileTokenRetriever doesn't trim the token before returning it.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 3.6.0
    • clients
    • None

    Description

      The FileTokenRetriever class is used to read the access_token from a file on the clients system and then the info is passed along with jaas config to the OAuthBearerSaslServer.

      The server uses the class OAuthBearerClientInitialResponse to validate the token format.

      In case the token was sent using FileTokenRetriever on the client side, some EOL character is getting appended to the token, causing authentication to fail with the message (in case to topic create):
       ERROR org.apache.kafka.common.errors.SaslAuthenticationException: Authentication failed during authentication due to invalid credentials with SASL mechanism OAUTHBEARER
       
      On the server side the following line https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/common/security/oauthbearer/internals/OAuthBearerClientInitialResponse.java#L68 with throw an exception failing the request.

      Attachments

        Issue Links

          Activity

            People

              smjn Sushant Mahajan
              sushmahajn Sushant Mahajan
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 1h
                  1h
                  Remaining:
                  Remaining Estimate - 1h
                  1h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified