Class CredentialUtils
- java.lang.Object
-
- software.amazon.awssdk.auth.credentials.CredentialUtils
-
public final class CredentialUtils extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
isAnonymous(AwsCredentials credentials)
Determine whether the provided credentials are anonymous credentials, indicating that the customer is not attempting to authenticate themselves.static boolean
isAnonymous(AwsCredentialsIdentity credentials)
Determine whether the provided credentials are anonymous credentials, indicating that the customer is not attempting to authenticate themselves.static AwsCredentials
toCredentials(AwsCredentialsIdentity awsCredentialsIdentity)
Converts anAwsCredentialsIdentity
toAwsCredentials
.static AwsCredentialsProvider
toCredentialsProvider(IdentityProvider<? extends AwsCredentialsIdentity> identityProvider)
Converts anIdentityProvider
toAwsCredentialsProvider
based 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 anAwsCredentialsIdentity
toAwsCredentials
.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
AwsCredentialsIdentity
andAwsSessionCredentialsIdentity
types. If the input is another sub-type that has other properties, they are not carried over. i.e.,- AwsSessionCredentialsIdentity -> AwsSessionCredentials
- AwsCredentialsIdentity -> AwsBasicCredentials
- Parameters:
awsCredentialsIdentity
- TheAwsCredentialsIdentity
to convert- Returns:
- The corresponding
AwsCredentials
-
toCredentialsProvider
public static AwsCredentialsProvider toCredentialsProvider(IdentityProvider<? extends AwsCredentialsIdentity> identityProvider)
Converts anIdentityProvider
toAwsCredentialsProvider
based 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
to convert- Returns:
- The corresponding
AwsCredentialsProvider
-
-