Class AwsSessionCredentials
java.lang.Object
software.amazon.awssdk.auth.credentials.AwsSessionCredentials
- All Implemented Interfaces:
AwsCredentials
,AwsCredentialsIdentity
,AwsSessionCredentialsIdentity
,Identity
@Immutable
public final class AwsSessionCredentials
extends Object
implements AwsCredentials, AwsSessionCredentialsIdentity
A special type of
AwsCredentials
that provides a session token to be used in service authentication. Session
tokens are typically provided by a token broker service, like AWS Security Token Service, and provide temporary access to an
AWS service.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
A builder for creating an instance ofAwsSessionCredentials
. -
Method Summary
Modifier and TypeMethodDescriptionRetrieve the AWS access key, used to identify the user interacting with AWS.builder()
Returns a builder for this object.static AwsSessionCredentials
Constructs a new session credentials object, with the specified AWS access key, AWS secret key and AWS session token.boolean
Retrieve the expiration time of these credentials, if it exists.int
hashCode()
Retrieve the AWS secret access key, used to authenticate the user interacting with AWS.Retrieve the AWS session token.toString()
-
Method Details
-
builder
Returns a builder for this object. -
create
Constructs a new session credentials object, with the specified AWS access key, AWS secret key and AWS session token.- Parameters:
accessKey
- The AWS access key, used to identify the user interacting with AWS.secretKey
- The AWS secret access key, used to authenticate the user interacting with AWS.sessionToken
- The AWS session token, retrieved from an AWS token service, used for authenticating that this user has received temporary permission to access some resource.
-
accessKeyId
Retrieve the AWS access key, used to identify the user interacting with AWS.- Specified by:
accessKeyId
in interfaceAwsCredentialsIdentity
-
secretAccessKey
Retrieve the AWS secret access key, used to authenticate the user interacting with AWS.- Specified by:
secretAccessKey
in interfaceAwsCredentialsIdentity
-
expirationTime
Retrieve the expiration time of these credentials, if it exists.- Specified by:
expirationTime
in interfaceIdentity
-
sessionToken
Retrieve the AWS session token. This token is retrieved from an AWS token service, and is used for authenticating that this user has received temporary permission to access some resource.- Specified by:
sessionToken
in interfaceAwsSessionCredentialsIdentity
-
toString
-
equals
-
hashCode
public int hashCode()
-