public class GetFederationTokenRequest extends AmazonWebServiceRequest implements Serializable
GetFederationToken operation
.
Returns a set of temporary security credentials (consisting of an access key ID, a secret access key, and a security token) for a federated user. A
typical use is in a proxy application that is getting temporary security credentials on behalf of distributed applications inside a corporate network.
Because you must call the GetFederationToken
action using the long-term security credentials of an IAM user, this call is appropriate in
contexts where those credentials can be safely stored, usually in a server-based application.
Note: Do not use this call in mobile applications or client-based web applications that directly get temporary security credentials. For those
types of applications, use AssumeRoleWithWebIdentity
.
The GetFederationToken
action must be called by using the long-term AWS security credentials of the AWS account or an IAM user.
Credentials that are created by IAM users are valid for the specified duration, between 900 seconds (15 minutes) and 129600 seconds (36 hours);
credentials that are created by using account credentials have a maximum duration of 3600 seconds (1 hour).
Optionally, you can pass an AWS IAM access policy to this operation. The temporary security credentials that are returned by the operation have the
permissions that are associated with the entity that is making the GetFederationToken
call, except for any permissions explicitly denied
by the policy you pass. This gives you a way to further restrict the permissions for the federated user. These policies and any applicable
resource-based policies are evaluated when calls to AWS are made using the temporary security credentials.
For more information about how permissions work, see Controlling
Permissions in Temporary Credentials in Using Temporary Security Credentials . For information about using
GetFederationToken
to create temporary security credentials, see Creating Temporary Credentials to Enable Access for Federated Users
in Using Temporary Security Credentials .
Constructor and Description |
---|
GetFederationTokenRequest()
Default constructor for a new GetFederationTokenRequest object.
|
GetFederationTokenRequest(String name)
Constructs a new GetFederationTokenRequest object.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
Integer |
getDurationSeconds()
The duration, in seconds, that the session should last.
|
String |
getName()
The name of the federated user.
|
String |
getPolicy()
An AWS IAM policy in JSON format.
|
int |
hashCode() |
void |
setDurationSeconds(Integer durationSeconds)
The duration, in seconds, that the session should last.
|
void |
setName(String name)
The name of the federated user.
|
void |
setPolicy(String policy)
An AWS IAM policy in JSON format.
|
String |
toString()
Returns a string representation of this object; useful for testing and
debugging.
|
GetFederationTokenRequest |
withDurationSeconds(Integer durationSeconds)
The duration, in seconds, that the session should last.
|
GetFederationTokenRequest |
withName(String name)
The name of the federated user.
|
GetFederationTokenRequest |
withPolicy(String policy)
An AWS IAM policy in JSON format.
|
copyPrivateRequestParameters, getRequestClientOptions, getRequestCredentials, getRequestMetricCollector, setRequestCredentials, setRequestMetricCollector, withRequestMetricCollector
public GetFederationTokenRequest()
public GetFederationTokenRequest(String name)
name
- The name of the federated user. The name is used as an
identifier for the temporary security credentials (such as
Bob
). For example, you can reference the federated user
name in a resource-based policy, such as in an Amazon S3 bucket
policy.public String getName()
Bob
). For
example, you can reference the federated user name in a resource-based
policy, such as in an Amazon S3 bucket policy.
Constraints:
Length: 2 - 32
Pattern: [\w+=,.@-]*
Bob
). For
example, you can reference the federated user name in a resource-based
policy, such as in an Amazon S3 bucket policy.public void setName(String name)
Bob
). For
example, you can reference the federated user name in a resource-based
policy, such as in an Amazon S3 bucket policy.
Constraints:
Length: 2 - 32
Pattern: [\w+=,.@-]*
name
- The name of the federated user. The name is used as an identifier for
the temporary security credentials (such as Bob
). For
example, you can reference the federated user name in a resource-based
policy, such as in an Amazon S3 bucket policy.public GetFederationTokenRequest withName(String name)
Bob
). For
example, you can reference the federated user name in a resource-based
policy, such as in an Amazon S3 bucket policy.
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 2 - 32
Pattern: [\w+=,.@-]*
name
- The name of the federated user. The name is used as an identifier for
the temporary security credentials (such as Bob
). For
example, you can reference the federated user name in a resource-based
policy, such as in an Amazon S3 bucket policy.public String getPolicy()
By default, federated users have no permissions; they do not inherit any from the IAM user. When you specify a policy, the federated user's permissions are based on the specified policy and the IAM user's policy. If you don't specify a policy, federated users can only access AWS resources that explicitly allow those federated users in a resource policy, such as in an Amazon S3 bucket policy.
Constraints:
Length: 1 - 2048
Pattern: [
-ÿ]+
By default, federated users have no permissions; they do not inherit any from the IAM user. When you specify a policy, the federated user's permissions are based on the specified policy and the IAM user's policy. If you don't specify a policy, federated users can only access AWS resources that explicitly allow those federated users in a resource policy, such as in an Amazon S3 bucket policy.
public void setPolicy(String policy)
By default, federated users have no permissions; they do not inherit any from the IAM user. When you specify a policy, the federated user's permissions are based on the specified policy and the IAM user's policy. If you don't specify a policy, federated users can only access AWS resources that explicitly allow those federated users in a resource policy, such as in an Amazon S3 bucket policy.
Constraints:
Length: 1 - 2048
Pattern: [
-ÿ]+
policy
- An AWS IAM policy in JSON format. By default, federated users have no permissions; they do not inherit any from the IAM user. When you specify a policy, the federated user's permissions are based on the specified policy and the IAM user's policy. If you don't specify a policy, federated users can only access AWS resources that explicitly allow those federated users in a resource policy, such as in an Amazon S3 bucket policy.
public GetFederationTokenRequest withPolicy(String policy)
By default, federated users have no permissions; they do not inherit any from the IAM user. When you specify a policy, the federated user's permissions are based on the specified policy and the IAM user's policy. If you don't specify a policy, federated users can only access AWS resources that explicitly allow those federated users in a resource policy, such as in an Amazon S3 bucket policy.
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 1 - 2048
Pattern: [
-ÿ]+
policy
- An AWS IAM policy in JSON format. By default, federated users have no permissions; they do not inherit any from the IAM user. When you specify a policy, the federated user's permissions are based on the specified policy and the IAM user's policy. If you don't specify a policy, federated users can only access AWS resources that explicitly allow those federated users in a resource policy, such as in an Amazon S3 bucket policy.
public Integer getDurationSeconds()
Constraints:
Range: 900 - 129600
public void setDurationSeconds(Integer durationSeconds)
Constraints:
Range: 900 - 129600
durationSeconds
- The duration, in seconds, that the session should last. Acceptable
durations for federation sessions range from 900 seconds (15 minutes)
to 129600 seconds (36 hours), with 43200 seconds (12 hours) as the
default. Sessions for AWS account owners are restricted to a maximum
of 3600 seconds (one hour). If the duration is longer than one hour,
the session for AWS account owners defaults to one hour.public GetFederationTokenRequest withDurationSeconds(Integer durationSeconds)
Returns a reference to this object so that method calls can be chained together.
Constraints:
Range: 900 - 129600
durationSeconds
- The duration, in seconds, that the session should last. Acceptable
durations for federation sessions range from 900 seconds (15 minutes)
to 129600 seconds (36 hours), with 43200 seconds (12 hours) as the
default. Sessions for AWS account owners are restricted to a maximum
of 3600 seconds (one hour). If the duration is longer than one hour,
the session for AWS account owners defaults to one hour.public String toString()
toString
in class Object
Object.toString()
Copyright © 2013 Amazon Web Services, Inc. All Rights Reserved.