com.amazonaws.auth
Class STSSessionCredentials

java.lang.Object
  extended by com.amazonaws.auth.STSSessionCredentials
All Implemented Interfaces:
AWSCredentials, AWSSessionCredentials

public class STSSessionCredentials
extends java.lang.Object
implements AWSSessionCredentials

Session credentials periodically refreshed by AWS SecurityTokenService


Field Summary
static int DEFAULT_DURATION_SECONDS
           
 
Constructor Summary
STSSessionCredentials(AWSCredentials credentials)
          Create a new credentials object that will periodically and automatically obtain a session from STS.
STSSessionCredentials(AWSCredentials credentials, int sessionDurationSeconds)
          Create a new credentials object that will periodically and automatically obtain a session from STS.
STSSessionCredentials(AWSSecurityTokenService stsClient)
          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)
          Create a new credentials object that will periodically and automatically obtain a session from STS, using a preconfigured STS client.
 
Method Summary
 java.lang.String getAWSAccessKeyId()
          Returns the AWS access key for the current STS session, beginning a new one if necessary.
 java.lang.String getAWSSecretKey()
          Returns the AWS secret key for the current STS session, beginning a new one if necessary.
 AWSSessionCredentials getImmutableCredentials()
          Returns immutable session credentials for this session, beginning a new one if necessary.
 java.lang.String getSessionToken()
          Returns the session token for the current STS session, beginning a new one if necessary.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_DURATION_SECONDS

public static final int DEFAULT_DURATION_SECONDS
See Also:
Constant Field Values
Constructor Detail

STSSessionCredentials

public STSSessionCredentials(AWSCredentials credentials)
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)
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)
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)
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 java.lang.String getAWSAccessKeyId()
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 interface AWSCredentials
Returns:
The AWS access key ID for this credentials object.

getAWSSecretKey

public java.lang.String getAWSSecretKey()
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 interface AWSCredentials
Returns:
The AWS secret access key for this credentials object.

getSessionToken

public java.lang.String getSessionToken()
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 interface AWSSessionCredentials

getImmutableCredentials

public AWSSessionCredentials getImmutableCredentials()
Returns immutable session credentials for this session, beginning a new one if necessary.



Copyright © 2010 Amazon Web Services, Inc. All Rights Reserved.