Class STSSessionCredentials
- java.lang.Object
-
- com.amazonaws.auth.STSSessionCredentials
-
- All Implemented Interfaces:
AWSCredentials
,AWSRefreshableSessionCredentials
,AWSSessionCredentials
@Deprecated public class STSSessionCredentials extends Object implements AWSRefreshableSessionCredentials
Deprecated.Session credentials periodically refreshed by AWS SecurityTokenService.Calls to
getAWSAccessKeyId()
,getAWSSecretKey()
, andgetSessionToken()
should be synchronized on this object to prevent races on the boundary of session expiration. Alternately, clients can callgetImmutableCredentials()
to ensure a consistent set of access key, secret key, and token.This class is deprecated and should not be used anymore. Instead, use
STSSessionCredentialsProvider
.
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_DURATION_SECONDS
Deprecated.
-
Constructor Summary
Constructors Constructor Description STSSessionCredentials(AWSCredentials credentials)
Deprecated.Create a new credentials object that will periodically and automatically obtain a session from STS.STSSessionCredentials(AWSCredentials credentials, int sessionDurationSeconds)
Deprecated.Create a new credentials object that will periodically and automatically obtain a session from STS.STSSessionCredentials(AWSSecurityTokenService stsClient)
Deprecated.Create a new credentials object that will periodically and automatically obtain a session from STS, using a preconfigured STS client.STSSessionCredentials(AWSSecurityTokenService stsClient, int sessionDuratinSeconds)
Deprecated.Create a new credentials object that will periodically and automatically obtain a session from STS, using a preconfigured STS client.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description String
getAWSAccessKeyId()
Deprecated.Returns the AWS access key for the current STS session, beginning a new one if necessary.String
getAWSSecretKey()
Deprecated.Returns the AWS secret key for the current STS session, beginning a new one if necessary.AWSSessionCredentials
getImmutableCredentials()
Deprecated.Returns immutable session credentials for this session, beginning a new one if necessary.String
getSessionToken()
Deprecated.Returns the session token for the current STS session, beginning a new one if necessary.void
refreshCredentials()
Deprecated.Refreshes the session credentials from STS.
-
-
-
Field Detail
-
DEFAULT_DURATION_SECONDS
public static final int DEFAULT_DURATION_SECONDS
Deprecated.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
STSSessionCredentials
public STSSessionCredentials(AWSCredentials credentials)
Deprecated.Create a new credentials object that will periodically and automatically obtain a session from STS.- Parameters:
credentials
- Primary AWS account credentials.
-
STSSessionCredentials
public STSSessionCredentials(AWSCredentials credentials, int sessionDurationSeconds)
Deprecated.Create a new credentials object that will periodically and automatically obtain a session from STS.- Parameters:
credentials
- Primary AWS account credentials.sessionDurationSeconds
- The duration, in seconds, for each session to last.
-
STSSessionCredentials
public STSSessionCredentials(AWSSecurityTokenService stsClient)
Deprecated.Create a new credentials object that will periodically and automatically obtain a session from STS, using a preconfigured STS client.- Parameters:
stsClient
- A pre-configured STS client from which to get credentials.
-
STSSessionCredentials
public STSSessionCredentials(AWSSecurityTokenService stsClient, int sessionDuratinSeconds)
Deprecated.Create a new credentials object that will periodically and automatically obtain a session from STS, using a preconfigured STS client.- Parameters:
stsClient
- A pre-configured STS client from which to get credentials.settings
- Session settings for all sessions created
-
-
Method Detail
-
getAWSAccessKeyId
public String getAWSAccessKeyId()
Deprecated.Returns the AWS access key for the current STS session, beginning a new one if necessary.Clients are encouraged to call the atomic
RenewableAWSSessionCredentials#getImmutableCredentials()
as a proxy to this method.- Specified by:
getAWSAccessKeyId
in interfaceAWSCredentials
- Returns:
- The AWS access key ID for this credentials object.
-
getAWSSecretKey
public String getAWSSecretKey()
Deprecated.Returns the AWS secret key for the current STS session, beginning a new one if necessary.Clients are encouraged to call the atomic
RenewableAWSSessionCredentials#getImmutableCredentials()
as a proxy to this method.- Specified by:
getAWSSecretKey
in interfaceAWSCredentials
- Returns:
- The AWS secret access key for this credentials object.
-
getSessionToken
public String getSessionToken()
Deprecated.Returns the session token for the current STS session, beginning a new one if necessary.Clients are encouraged to call the atomic
RenewableAWSSessionCredentials#getImmutableCredentials()
as a proxy to this method.- Specified by:
getSessionToken
in interfaceAWSSessionCredentials
-
getImmutableCredentials
public AWSSessionCredentials getImmutableCredentials()
Deprecated.Returns immutable session credentials for this session, beginning a new one if necessary.
-
refreshCredentials
public void refreshCredentials()
Deprecated.Refreshes the session credentials from STS.- Specified by:
refreshCredentials
in interfaceAWSRefreshableSessionCredentials
-
-