Class AwsSessionCredentials
java.lang.Object
software.amazon.awssdk.auth.credentials.AwsSessionCredentials
- All Implemented Interfaces:
AwsCredentials
,AwsCredentialsIdentity
,AwsSessionCredentialsIdentity
,Identity
,ToCopyableBuilder<AwsSessionCredentials.Builder,
AwsSessionCredentials>
@Immutable
public final class AwsSessionCredentials
extends Object
implements AwsCredentials, AwsSessionCredentialsIdentity, ToCopyableBuilder<AwsSessionCredentials.Builder,AwsSessionCredentials>
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
Modifier 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.copy
(Consumer<? super AwsSessionCredentials.Builder> modifier) A convenience method for callingToCopyableBuilder.toBuilder()
, updating the returned builder and then callingSdkBuilder.build()
.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()
The name of the identity provider that created this credential identity.Retrieve the AWS secret access key, used to authenticate the user interacting with AWS.Retrieve the AWS session token.Take this object and create a builder that contains all of the current property values of this object.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
-
providerName
The name of the identity provider that created this credential identity.- Specified by:
providerName
in interfaceIdentity
-
toString
-
equals
-
hashCode
public int hashCode() -
toBuilder
Description copied from interface:ToCopyableBuilder
Take this object and create a builder that contains all of the current property values of this object.- Specified by:
toBuilder
in interfaceToCopyableBuilder<AwsSessionCredentials.Builder,
AwsSessionCredentials> - Returns:
- a builder for type T
-
copy
Description copied from interface:ToCopyableBuilder
A convenience method for callingToCopyableBuilder.toBuilder()
, updating the returned builder and then callingSdkBuilder.build()
. This is useful for making small modifications to the existing object.- Specified by:
copy
in interfaceToCopyableBuilder<AwsSessionCredentials.Builder,
AwsSessionCredentials> - Parameters:
modifier
- A function that mutates this immutable object using the provided builder.- Returns:
- A new copy of this object with the requested modifications.
-