Class CredentialUtils
java.lang.Object
software.amazon.awssdk.auth.credentials.CredentialUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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 anIdentityProvider<? extends AwsCredentialsIdentity>toAwsCredentialsProviderbased ontoCredentials(AwsCredentialsIdentity).
-
Method Details
-
isAnonymous
Determine whether the provided credentials are anonymous credentials, indicating that the customer is not attempting to authenticate themselves. -
isAnonymous
Determine whether the provided credentials are anonymous credentials, indicating that the customer is not attempting to authenticate themselves. -
toCredentials
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 anIdentityProvider<? extends AwsCredentialsIdentity>toAwsCredentialsProviderbased 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- TheIdentityProvider<? extends AwsCredentialsIdentity>to convert- Returns:
- The corresponding
AwsCredentialsProvider
-