Class CredentialUtils
- java.lang.Object
-
- software.amazon.awssdk.auth.credentials.CredentialUtils
-
@SdkProtectedApi public final class CredentialUtils extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanisAnonymous(AwsCredentials credentials)Determine whether the provided credentials are anonymous credentials, indicating that the customer is not attempting to authenticate themselves.static booleanisAnonymous(AwsCredentialsIdentity credentials)Determine whether the provided credentials are anonymous credentials, indicating that the customer is not attempting to authenticate themselves.static AwsCredentialstoCredentials(AwsCredentialsIdentity awsCredentialsIdentity)Converts anAwsCredentialsIdentitytoAwsCredentials.static AwsCredentialsProvidertoCredentialsProvider(IdentityProvider<? extends AwsCredentialsIdentity> identityProvider)Converts anIdentityProvidertoAwsCredentialsProviderbased ontoCredentials(AwsCredentialsIdentity).
-
-
-
Method Detail
-
isAnonymous
public static boolean isAnonymous(AwsCredentials credentials)
Determine whether the provided credentials are anonymous credentials, indicating that the customer is not attempting to authenticate themselves.
-
isAnonymous
public static boolean isAnonymous(AwsCredentialsIdentity credentials)
Determine whether the provided credentials are anonymous credentials, indicating that the customer is not attempting to authenticate themselves.
-
toCredentials
public static AwsCredentials toCredentials(AwsCredentialsIdentity awsCredentialsIdentity)
Converts anAwsCredentialsIdentitytoAwsCredentials.Usage of the new AwsCredentialsIdentity type is preferred over AwsCredentials. But some places may need to still convert to the older AwsCredentials type to work with existing code.
The conversion is only aware of
AwsCredentialsIdentityandAwsSessionCredentialsIdentitytypes. If the input is another sub-type that has other properties, they are not carried over. i.e.,- AwsSessionCredentialsIdentity -> AwsSessionCredentials
- AwsCredentialsIdentity -> AwsBasicCredentials
- Parameters:
awsCredentialsIdentity- TheAwsCredentialsIdentityto convert- Returns:
- The corresponding
AwsCredentials
-
toCredentialsProvider
public static AwsCredentialsProvider toCredentialsProvider(IdentityProvider<? extends AwsCredentialsIdentity> identityProvider)
Converts anIdentityProvidertoAwsCredentialsProviderbased ontoCredentials(AwsCredentialsIdentity).Usage of the new IdentityProvider type is preferred over AwsCredentialsProvider. But some places may need to still convert to the older AwsCredentialsProvider type to work with existing code.
- Parameters:
identityProvider- TheIdentityProviderto convert- Returns:
- The corresponding
AwsCredentialsProvider
-
-