Class AwsSessionCredentials
java.lang.Object
software.amazon.awssdk.auth.credentials.AwsSessionCredentials
- All Implemented Interfaces:
AwsCredentials,AwsCredentialsIdentity,AwsSessionCredentialsIdentity,Identity,ToCopyableBuilder<AwsSessionCredentials.Builder,AwsSessionCredentials>
@Immutable
@SdkPublicApi
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
Nested ClassesModifier and TypeClassDescriptionstatic final classA builder for creating an instance ofAwsSessionCredentials. -
Method Summary
Modifier and TypeMethodDescriptionRetrieve the AWS access key, used to identify the user interacting with AWS.Retrieve the AWS account id associated with this credentials identity, if found.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 AwsSessionCredentialsConstructs a new session credentials object, with the specified AWS access key, AWS secret key and AWS session token.booleanRetrieve the expiration time of these credentials, if it exists.inthashCode()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:
accessKeyIdin interfaceAwsCredentialsIdentity
-
secretAccessKey
Retrieve the AWS secret access key, used to authenticate the user interacting with AWS.- Specified by:
secretAccessKeyin interfaceAwsCredentialsIdentity
-
expirationTime
Retrieve the expiration time of these credentials, if it exists.- Specified by:
expirationTimein 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:
sessionTokenin interfaceAwsSessionCredentialsIdentity
-
providerName
The name of the identity provider that created this credential identity.- Specified by:
providerNamein interfaceIdentity
-
accountId
Description copied from interface:AwsCredentialsIdentityRetrieve the AWS account id associated with this credentials identity, if found.- Specified by:
accountIdin interfaceAwsCredentialsIdentity
-
toString
-
equals
-
hashCode
-
toBuilder
Description copied from interface:ToCopyableBuilderTake this object and create a builder that contains all of the current property values of this object.- Specified by:
toBuilderin interfaceToCopyableBuilder<AwsSessionCredentials.Builder,AwsSessionCredentials> - Returns:
- a builder for type T
-
copy
Description copied from interface:ToCopyableBuilderA 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:
copyin 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.
-