com.amazonaws.services.securitytoken.model
Class AssumeRoleWithSAMLRequest

java.lang.Object
  extended by com.amazonaws.AmazonWebServiceRequest
      extended by com.amazonaws.services.securitytoken.model.AssumeRoleWithSAMLRequest
All Implemented Interfaces:
java.io.Serializable

public class AssumeRoleWithSAMLRequest
extends AmazonWebServiceRequest
implements java.io.Serializable

Container for the parameters to the AssumeRoleWithSAML operation.

Returns a set of temporary security credentials for users who have been authenticated via a SAML authentication response. This operation provides a mechanism for tying an enterprise identity store or directory to role-based AWS access without user-specific credentials or configuration.

The temporary security credentials returned by this operation consist of an access key ID, a secret access key, and a security token. Applications can use these temporary security credentials to sign calls to AWS services. The credentials are valid for the duration that you specified when calling AssumeRoleWithSAML , which can be up to 3600 seconds (1 hour) or until the time specified in the SAML authentication response's NotOnOrAfter value, whichever is shorter.

NOTE:The maximum duration for a session is 1 hour, and the minimum duration is 15 minutes, even if values outside this range are specified.

Optionally, you can pass an IAM access policy to this operation. If you choose not to pass a policy, the temporary security credentials that are returned by the operation have the permissions that are defined in the access policy of the role that is being assumed. If you pass a policy to this operation, the temporary security credentials that are returned by the operation have the permissions that are allowed by both the access policy of the role that is being assumed, and the policy that you pass. This gives you a way to further restrict the permissions for the resulting temporary security credentials. You cannot use the passed policy to grant permissions that are in excess of those allowed by the access policy of the role that is being assumed. For more information, see Permissions for AssumeRoleWithSAML in Using Temporary Security Credentials .

Before your application can call AssumeRoleWithSAML , you must configure your SAML identity provider (IdP) to issue the claims required by AWS. Additionally, you must use AWS Identity and Access Management (IAM) to create a SAML provider entity in your AWS account that represents your identity provider, and create an IAM role that specifies this SAML provider in its trust policy.

Calling AssumeRoleWithSAML does not require the use of AWS security credentials. The identity of the caller is validated by using keys in the metadata document that is uploaded for the SAML provider entity for your identity provider.

For more information, see the following resources:

See Also:
AWSSecurityTokenService.assumeRoleWithSAML(AssumeRoleWithSAMLRequest), Serialized Form

Constructor Summary
AssumeRoleWithSAMLRequest()
           
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.Integer getDurationSeconds()
          The duration, in seconds, of the role session.
 java.lang.String getPolicy()
          An IAM policy in JSON format.
 java.lang.String getPrincipalArn()
          The Amazon Resource Name (ARN) of the SAML provider in IAM that describes the IdP.
 java.lang.String getRoleArn()
          The Amazon Resource Name (ARN) of the role that the caller is assuming.
 java.lang.String getSAMLAssertion()
          The base-64 encoded SAML authentication response provided by the IdP.
 int hashCode()
           
 void setDurationSeconds(java.lang.Integer durationSeconds)
          The duration, in seconds, of the role session.
 void setPolicy(java.lang.String policy)
          An IAM policy in JSON format.
 void setPrincipalArn(java.lang.String principalArn)
          The Amazon Resource Name (ARN) of the SAML provider in IAM that describes the IdP.
 void setRoleArn(java.lang.String roleArn)
          The Amazon Resource Name (ARN) of the role that the caller is assuming.
 void setSAMLAssertion(java.lang.String sAMLAssertion)
          The base-64 encoded SAML authentication response provided by the IdP.
 java.lang.String toString()
          Returns a string representation of this object; useful for testing and debugging.
 AssumeRoleWithSAMLRequest withDurationSeconds(java.lang.Integer durationSeconds)
          The duration, in seconds, of the role session.
 AssumeRoleWithSAMLRequest withPolicy(java.lang.String policy)
          An IAM policy in JSON format.
 AssumeRoleWithSAMLRequest withPrincipalArn(java.lang.String principalArn)
          The Amazon Resource Name (ARN) of the SAML provider in IAM that describes the IdP.
 AssumeRoleWithSAMLRequest withRoleArn(java.lang.String roleArn)
          The Amazon Resource Name (ARN) of the role that the caller is assuming.
 AssumeRoleWithSAMLRequest withSAMLAssertion(java.lang.String sAMLAssertion)
          The base-64 encoded SAML authentication response provided by the IdP.
 
Methods inherited from class com.amazonaws.AmazonWebServiceRequest
copyPrivateRequestParameters, getDelegationToken, getRequestClientOptions, getRequestCredentials, getRequestMetricCollector, setDelegationToken, setRequestCredentials, setRequestMetricCollector, withRequestMetricCollector
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AssumeRoleWithSAMLRequest

public AssumeRoleWithSAMLRequest()
Method Detail

getRoleArn

public java.lang.String getRoleArn()
The Amazon Resource Name (ARN) of the role that the caller is assuming.

Constraints:
Length: 20 - 2048

Returns:
The Amazon Resource Name (ARN) of the role that the caller is assuming.

setRoleArn

public void setRoleArn(java.lang.String roleArn)
The Amazon Resource Name (ARN) of the role that the caller is assuming.

Constraints:
Length: 20 - 2048

Parameters:
roleArn - The Amazon Resource Name (ARN) of the role that the caller is assuming.

withRoleArn

public AssumeRoleWithSAMLRequest withRoleArn(java.lang.String roleArn)
The Amazon Resource Name (ARN) of the role that the caller is assuming.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Length: 20 - 2048

Parameters:
roleArn - The Amazon Resource Name (ARN) of the role that the caller is assuming.
Returns:
A reference to this updated object so that method calls can be chained together.

getPrincipalArn

public java.lang.String getPrincipalArn()
The Amazon Resource Name (ARN) of the SAML provider in IAM that describes the IdP.

Constraints:
Length: 20 - 2048

Returns:
The Amazon Resource Name (ARN) of the SAML provider in IAM that describes the IdP.

setPrincipalArn

public void setPrincipalArn(java.lang.String principalArn)
The Amazon Resource Name (ARN) of the SAML provider in IAM that describes the IdP.

Constraints:
Length: 20 - 2048

Parameters:
principalArn - The Amazon Resource Name (ARN) of the SAML provider in IAM that describes the IdP.

withPrincipalArn

public AssumeRoleWithSAMLRequest withPrincipalArn(java.lang.String principalArn)
The Amazon Resource Name (ARN) of the SAML provider in IAM that describes the IdP.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Length: 20 - 2048

Parameters:
principalArn - The Amazon Resource Name (ARN) of the SAML provider in IAM that describes the IdP.
Returns:
A reference to this updated object so that method calls can be chained together.

getSAMLAssertion

public java.lang.String getSAMLAssertion()
The base-64 encoded SAML authentication response provided by the IdP.

For more information, see Configuring a Relying Party and Adding Claims in the Using IAM guide.

Constraints:
Length: 4 - 50000

Returns:
The base-64 encoded SAML authentication response provided by the IdP.

For more information, see Configuring a Relying Party and Adding Claims in the Using IAM guide.


setSAMLAssertion

public void setSAMLAssertion(java.lang.String sAMLAssertion)
The base-64 encoded SAML authentication response provided by the IdP.

For more information, see Configuring a Relying Party and Adding Claims in the Using IAM guide.

Constraints:
Length: 4 - 50000

Parameters:
sAMLAssertion - The base-64 encoded SAML authentication response provided by the IdP.

For more information, see Configuring a Relying Party and Adding Claims in the Using IAM guide.


withSAMLAssertion

public AssumeRoleWithSAMLRequest withSAMLAssertion(java.lang.String sAMLAssertion)
The base-64 encoded SAML authentication response provided by the IdP.

For more information, see Configuring a Relying Party and Adding Claims in the Using IAM guide.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Length: 4 - 50000

Parameters:
sAMLAssertion - The base-64 encoded SAML authentication response provided by the IdP.

For more information, see Configuring a Relying Party and Adding Claims in the Using IAM guide.

Returns:
A reference to this updated object so that method calls can be chained together.

getPolicy

public java.lang.String getPolicy()
An IAM policy in JSON format.

The policy parameter is optional. If you pass a policy, the temporary security credentials that are returned by the operation have the permissions that are allowed by both the access policy of the role that is being assumed, and the policy that you pass. This gives you a way to further restrict the permissions for the resulting temporary security credentials. You cannot use the passed policy to grant permissions that are in excess of those allowed by the access policy of the role that is being assumed. For more information, see Permissions for AssumeRoleWithSAML in Using Temporary Security Credentials. The policy must be 2048 bytes or shorter, and its packed size must be less than 450 bytes.

Constraints:
Length: 1 - 2048
Pattern: [\u0009\u000A\u000D\u0020-\u00FF]+

Returns:
An IAM policy in JSON format.

The policy parameter is optional. If you pass a policy, the temporary security credentials that are returned by the operation have the permissions that are allowed by both the access policy of the role that is being assumed, and the policy that you pass. This gives you a way to further restrict the permissions for the resulting temporary security credentials. You cannot use the passed policy to grant permissions that are in excess of those allowed by the access policy of the role that is being assumed. For more information, see Permissions for AssumeRoleWithSAML in Using Temporary Security Credentials. The policy must be 2048 bytes or shorter, and its packed size must be less than 450 bytes.


setPolicy

public void setPolicy(java.lang.String policy)
An IAM policy in JSON format.

The policy parameter is optional. If you pass a policy, the temporary security credentials that are returned by the operation have the permissions that are allowed by both the access policy of the role that is being assumed, and the policy that you pass. This gives you a way to further restrict the permissions for the resulting temporary security credentials. You cannot use the passed policy to grant permissions that are in excess of those allowed by the access policy of the role that is being assumed. For more information, see Permissions for AssumeRoleWithSAML in Using Temporary Security Credentials. The policy must be 2048 bytes or shorter, and its packed size must be less than 450 bytes.

Constraints:
Length: 1 - 2048
Pattern: [\u0009\u000A\u000D\u0020-\u00FF]+

Parameters:
policy - An IAM policy in JSON format.

The policy parameter is optional. If you pass a policy, the temporary security credentials that are returned by the operation have the permissions that are allowed by both the access policy of the role that is being assumed, and the policy that you pass. This gives you a way to further restrict the permissions for the resulting temporary security credentials. You cannot use the passed policy to grant permissions that are in excess of those allowed by the access policy of the role that is being assumed. For more information, see Permissions for AssumeRoleWithSAML in Using Temporary Security Credentials. The policy must be 2048 bytes or shorter, and its packed size must be less than 450 bytes.


withPolicy

public AssumeRoleWithSAMLRequest withPolicy(java.lang.String policy)
An IAM policy in JSON format.

The policy parameter is optional. If you pass a policy, the temporary security credentials that are returned by the operation have the permissions that are allowed by both the access policy of the role that is being assumed, and the policy that you pass. This gives you a way to further restrict the permissions for the resulting temporary security credentials. You cannot use the passed policy to grant permissions that are in excess of those allowed by the access policy of the role that is being assumed. For more information, see Permissions for AssumeRoleWithSAML in Using Temporary Security Credentials. The policy must be 2048 bytes or shorter, and its packed size must be less than 450 bytes.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Length: 1 - 2048
Pattern: [\u0009\u000A\u000D\u0020-\u00FF]+

Parameters:
policy - An IAM policy in JSON format.

The policy parameter is optional. If you pass a policy, the temporary security credentials that are returned by the operation have the permissions that are allowed by both the access policy of the role that is being assumed, and the policy that you pass. This gives you a way to further restrict the permissions for the resulting temporary security credentials. You cannot use the passed policy to grant permissions that are in excess of those allowed by the access policy of the role that is being assumed. For more information, see Permissions for AssumeRoleWithSAML in Using Temporary Security Credentials. The policy must be 2048 bytes or shorter, and its packed size must be less than 450 bytes.

Returns:
A reference to this updated object so that method calls can be chained together.

getDurationSeconds

public java.lang.Integer getDurationSeconds()
The duration, in seconds, of the role session. The value can range from 900 seconds (15 minutes) to 3600 seconds (1 hour). By default, the value is set to 3600 seconds. An expiration can also be specified in the SAML authentication response's NotOnOrAfter value. The actual expiration time is whichever value is shorter. The maximum duration for a session is 1 hour, and the minimum duration is 15 minutes, even if values outside this range are specified.

Constraints:
Range: 900 - 129600

Returns:
The duration, in seconds, of the role session. The value can range from 900 seconds (15 minutes) to 3600 seconds (1 hour). By default, the value is set to 3600 seconds. An expiration can also be specified in the SAML authentication response's NotOnOrAfter value. The actual expiration time is whichever value is shorter. The maximum duration for a session is 1 hour, and the minimum duration is 15 minutes, even if values outside this range are specified.

setDurationSeconds

public void setDurationSeconds(java.lang.Integer durationSeconds)
The duration, in seconds, of the role session. The value can range from 900 seconds (15 minutes) to 3600 seconds (1 hour). By default, the value is set to 3600 seconds. An expiration can also be specified in the SAML authentication response's NotOnOrAfter value. The actual expiration time is whichever value is shorter. The maximum duration for a session is 1 hour, and the minimum duration is 15 minutes, even if values outside this range are specified.

Constraints:
Range: 900 - 129600

Parameters:
durationSeconds - The duration, in seconds, of the role session. The value can range from 900 seconds (15 minutes) to 3600 seconds (1 hour). By default, the value is set to 3600 seconds. An expiration can also be specified in the SAML authentication response's NotOnOrAfter value. The actual expiration time is whichever value is shorter. The maximum duration for a session is 1 hour, and the minimum duration is 15 minutes, even if values outside this range are specified.

withDurationSeconds

public AssumeRoleWithSAMLRequest withDurationSeconds(java.lang.Integer durationSeconds)
The duration, in seconds, of the role session. The value can range from 900 seconds (15 minutes) to 3600 seconds (1 hour). By default, the value is set to 3600 seconds. An expiration can also be specified in the SAML authentication response's NotOnOrAfter value. The actual expiration time is whichever value is shorter. The maximum duration for a session is 1 hour, and the minimum duration is 15 minutes, even if values outside this range are specified.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Range: 900 - 129600

Parameters:
durationSeconds - The duration, in seconds, of the role session. The value can range from 900 seconds (15 minutes) to 3600 seconds (1 hour). By default, the value is set to 3600 seconds. An expiration can also be specified in the SAML authentication response's NotOnOrAfter value. The actual expiration time is whichever value is shorter. The maximum duration for a session is 1 hour, and the minimum duration is 15 minutes, even if values outside this range are specified.
Returns:
A reference to this updated object so that method calls can be chained together.

toString

public java.lang.String toString()
Returns a string representation of this object; useful for testing and debugging.

Overrides:
toString in class java.lang.Object
Returns:
A string representation of this object.
See Also:
Object.toString()

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object


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