public class LoginCredentialsProviderFactory
extends java.lang.Object
AwsCredentialsProvider for AWS profiles that authenticate via a
login_session entry (the AWS Sign-In / browser-login credential flow).
The AWS SDK resolves login_session credentials through a LoginCredentialsProvider
whose region is carried by an internally constructed SigninClient. When that provider is
built through the profile-credentials factory (i.e. through DefaultCredentialsProvider),
the SigninClient region is resolved via the SDK's DefaultAwsRegionProviderChain,
which ignores the configured AWS profile and falls back to the default profile. This
factory instead constructs the provider with a SigninClient scoped to the region that the
driver already resolved for the connection, so the configured profile is honored.
The software.amazon.awssdk:signin module is optional and is therefore accessed purely
via reflection. This class only reaches the reflective code path when the connected profile
actually declares a login_session entry.
| Constructor and Description |
|---|
LoginCredentialsProviderFactory() |
| Modifier and Type | Method and Description |
|---|---|
static @Nullable software.amazon.awssdk.auth.credentials.AwsCredentialsProvider |
create(@Nullable java.lang.String awsProfileName,
@Nullable software.amazon.awssdk.regions.Region region)
Attempts to build a login-session credentials provider for the given profile.
|
public static @Nullable software.amazon.awssdk.auth.credentials.AwsCredentialsProvider create(@Nullable java.lang.String awsProfileName,
@Nullable software.amazon.awssdk.regions.Region region)
awsProfileName - the configured AWS profile name, or null/empty to use the default profile.region - the region resolved for the connection, used to scope the signin exchange.login_session entry (in which case the caller should fall back to the standard
credentials provider).java.lang.RuntimeException - if the profile uses a login_session entry but the login flow
cannot be set up (signin module missing, region unknown, or reflective construction failed).