diff --git a/core/auth/src/main/java/software/amazon/awssdk/auth/credentials/internal/WebIdentityCredentialsUtils.java b/core/auth/src/main/java/software/amazon/awssdk/auth/credentials/internal/WebIdentityCredentialsUtils.java index d14e28da54fb..44fe98d4bd20 100644 --- a/core/auth/src/main/java/software/amazon/awssdk/auth/credentials/internal/WebIdentityCredentialsUtils.java +++ b/core/auth/src/main/java/software/amazon/awssdk/auth/credentials/internal/WebIdentityCredentialsUtils.java @@ -19,12 +19,14 @@ import software.amazon.awssdk.annotations.SdkInternalApi; import software.amazon.awssdk.auth.credentials.WebIdentityTokenCredentialsProviderFactory; import software.amazon.awssdk.core.internal.util.ClassLoaderHelper; +import software.amazon.awssdk.utils.Logger; /** * Utility class used to configure credential providers based on JWT web identity tokens. */ @SdkInternalApi public final class WebIdentityCredentialsUtils { + private static final Logger log = Logger.loggerFor(WebIdentityCredentialsUtils.class); private static final String STS_WEB_IDENTITY_CREDENTIALS_PROVIDER_FACTORY = "software.amazon.awssdk.services.sts.internal.StsWebIdentityCredentialsProviderFactory"; @@ -44,7 +46,9 @@ public static WebIdentityTokenCredentialsProviderFactory factory() { WebIdentityCredentialsUtils.class); return (WebIdentityTokenCredentialsProviderFactory) stsCredentialsProviderFactory.getConstructor().newInstance(); } catch (ClassNotFoundException e) { - throw new IllegalStateException("To use web identity tokens, the 'sts' service module must be on the class path.", e); + String message = "To use web identity tokens, the 'sts' service module must be on the class path."; + log.warn(() -> message); + throw new IllegalStateException(message, e); } catch (NoSuchMethodException | InvocationTargetException | InstantiationException | IllegalAccessException e) { throw new IllegalStateException("Failed to create a web identity token credentials provider.", e); }