diff --git a/src/main/java/software/amazon/msk/auth/iam/IAMOAuthBearerLoginCallbackHandler.java b/src/main/java/software/amazon/msk/auth/iam/IAMOAuthBearerLoginCallbackHandler.java index fac42c9..dc5018b 100644 --- a/src/main/java/software/amazon/msk/auth/iam/IAMOAuthBearerLoginCallbackHandler.java +++ b/src/main/java/software/amazon/msk/auth/iam/IAMOAuthBearerLoginCallbackHandler.java @@ -136,6 +136,7 @@ private void handleCallback(OAuthBearerTokenCallback callback) throws IOExceptio if (callback.token() != null) { throw new IllegalArgumentException("Callback had a token already"); } + credentialsProvider.refresh(); AWSCredentials awsCredentials = credentialsProvider.getCredentials(); // Generate token value i.e. Base64 encoded pre-signed URL string