Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IAMOAuthBearerLoginCallbackHandler uses wrong profile to look up region #160

Open
hgschmie opened this issue Apr 2, 2024 · 0 comments
Open

Comments

@hgschmie
Copy link

hgschmie commented Apr 2, 2024

I am using profile configuration and have a profile called "qa-kafka" that contains my credentials and the necessary region where I connect to MSK.

When authenticating Kafka using an OAuth Bearer Token, it creates an instance of IAMOAuthBearerLoginCallbackHandler and then configures it. The MSKCredentialProvider instance is configured correctly:
Screenshot 2024-04-02 at 16 30 27

However, the awsRegionProvider field is unconditionally configured as a DefaultAwsRegionProviderChain instance. As a result, the profile there is default:

Screenshot 2024-04-02 at 16 31 32

I do not have a default profile configured; now my kafka authentication fails with

[INFO ] [AdminClient clientId=<xxx>] Failed authentication with <yyy>.kafka.us-west-2.amazonaws.com/a.b.c.d (channelId=-3) (An error: (java.security.PrivilegedActionException: javax.security.sasl.SaslException: AWS region could not be resolved. [Caused by java.io.IOException: AWS region could not be resolved.]) occurred when evaluating SASL token received from the Kafka Broker. Kafka Client will go to AUTHENTICATION_FAILED state.)

This seems to be a bug. The region provider should use the same profile as the credential provider.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant