Failed to send request to proxy due to 401

Hello,

I am currently using the confluent 7.0.1 community version on premise.
I tested the kafka rest proxy without Basic Auth enable and was able to publish a message on a topic.
Then I looked at this documentation to configure the HTTP basic auth.

Adding :

authentication.method=BASIC
authentication.realm=KafkaRest
authentication.roles=*

in kafka-rest.properties file and

created the rest-jaas.properties file within the following configuration :

KafkaRest {
    org.eclipse.jetty.jaas.spi.PropertyFileLoginModule required
    debug="true"
    file="<path-to-confluent>/etc/kafka-rest/password.properties";
};

and also created the password.properties file with the user info.

I also tested it on the browser using http://localhost:8082/topics/ and was not able to authenticate with the user/pass configured in the password.properties file.

Hi, did you manage find the solution? I’m having the exact same problem

Based on the Jetty javadoc here, I believe that it should be authentication.roles=**

That works in my testing while authentication.roles=* doesn’t (though I get a 403 HTTP error rather than 401).

Could you please give that a shot and report back?

no change, still getting 401, I think the request fails at the authentication stage before authorization takes place. I should add, this is a local instance in the development environment.

Thanks

Got it to work, problem was with the Kafka rest start command. Path to the JAAS file had a typo.

1 Like