@Deprecated public class STSSessionCredentials extends Object implements AWSRefreshableSessionCredentials
Calls to getAWSAccessKeyId()
,
getAWSSecretKey()
, and
getSessionToken()
should be synchronized on
this object to prevent races on the boundary of session expiration.
Alternately, clients can call
getImmutableCredentials()
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
.
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_DURATION_SECONDS
Deprecated.
|
Constructor and 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.
|
Modifier and Type | Method and 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.
|
public static final int DEFAULT_DURATION_SECONDS
public STSSessionCredentials(AWSCredentials credentials)
credentials
- Primary AWS account credentials.public STSSessionCredentials(AWSCredentials credentials, int sessionDurationSeconds)
credentials
- Primary AWS account credentials.sessionDurationSeconds
- The duration, in seconds, for each session to last.public STSSessionCredentials(AWSSecurityTokenService stsClient)
stsClient
- A pre-configured STS client from which to get credentials.public STSSessionCredentials(AWSSecurityTokenService stsClient, int sessionDuratinSeconds)
stsClient
- A pre-configured STS client from which to get credentials.settings
- Session settings for all sessions createdpublic String getAWSAccessKeyId()
Clients are encouraged to call the atomic
RenewableAWSSessionCredentials#getImmutableCredentials()
as a proxy to this method.
getAWSAccessKeyId
in interface AWSCredentials
public String getAWSSecretKey()
Clients are encouraged to call the atomic
RenewableAWSSessionCredentials#getImmutableCredentials()
as a proxy to this method.
getAWSSecretKey
in interface AWSCredentials
public String getSessionToken()
Clients are encouraged to call the atomic
RenewableAWSSessionCredentials#getImmutableCredentials()
as a proxy to this method.
getSessionToken
in interface AWSSessionCredentials
public AWSSessionCredentials getImmutableCredentials()
public void refreshCredentials()
refreshCredentials
in interface AWSRefreshableSessionCredentials
Copyright © 2013 Amazon Web Services, Inc. All Rights Reserved.