STSClient.get_federation_token
rboto-sts==0.4.0 · Service index · Types
Model summary (excerpt): Returns a set of temporary security credentials (consisting of an access key ID, a secret access key, and a security token) for a user. A typical use is in a proxy application that gets temporary security credentials on behalf of distributed applications inside a corporate network. You must call the GetFederationToken operation using the long-term security credentials of an IAM user. As a...
Install and imports
from rboto import STSClient
from collections.abc import Sequence
from rboto_sts.types import (
GetFederationTokenOutput,
PolicyDescriptorType,
Tag,
)
Signature
async def get_federation_token(
*,
name: str,
policy: str | None = None,
policy_arns: Sequence[PolicyDescriptorType] | None = None,
duration_seconds: int | None = None,
tags: Sequence[Tag] | None = None,
minimum_session_token_size: int | None = None,
) -> GetFederationTokenOutput: ...
Arguments without defaults are required. None omits an optional request argument. Static types do not validate resource existence, permissions, lengths, ranges, or conditional service requirements.
Arguments
| Argument | Required | Model notes (excerpt) |
|---|---|---|
name |
Yes | 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. The regex used to validate this parameter is a string of characters consisting of upper- and lower-case alphanumeric characters with no spaces. You can... |
policy |
No | An IAM policy in JSON format that you want to use as an inline session policy. You must pass an inline or managed session policy to this operation. You can pass a single JSON policy document to use as an inline session policy. You can also specify up to 10 managed policy Amazon Resource Names (ARNs) to use as managed session policies. This parameter is optional. However, if you do not pass any... |
policy_arns |
No | The Amazon Resource Names (ARNs) of the IAM managed policies that you want to use as a managed session policy. The policies must exist in the same account as the IAM user that is requesting federated access. You must pass an inline or managed session policy to this operation. You can pass a single JSON policy document to use as an inline session policy. You can also specify up to 10 managed... |
duration_seconds |
No | The duration, in seconds, that the session should last. Acceptable durations for federation sessions range from 900 seconds (15 minutes) to 129,600 seconds (36 hours), with 43,200 seconds (12 hours) as the default. Sessions obtained using root user credentials are restricted to a maximum of 3,600 seconds (one hour). If the specified duration is longer than one hour, the session obtained by... |
tags |
No | A list of session tags. Each session tag consists of a key name and an associated value. For more information about session tags, see Passing Session Tags in STS in the IAM User Guide . This parameter is optional. You can pass up to 50 session tags. The plaintext session tag keys can’t exceed 128 characters and the values can’t exceed 256 characters. For these and additional limits, see IAM... |
minimum_session_token_size |
No |
Output
GetFederationTokenOutput.
Read-only native attributes, accessed as response.field. Collection getters materialize Python values; to_dict() recursively materializes a mapping. Streams are consumed once.
| Field | Type | Presence | References |
|---|---|---|---|
credentials |
CredentialsOutput | None |
Always present | CredentialsOutput |
federated_user |
FederatedUserOutput | None |
Always present | FederatedUserOutput |
packed_policy_size |
int | None |
Always present | — |
session_token_utilization |
int | None |
Always present | — |
session_token_size |
int | None |
Always present | — |
| None means a value can be absent. Output mappings include every declared key; optional input keys may be omitted. Unknown output enum/union variants are not automatically valid inputs.
Related types
GetFederationTokenOutput, PolicyDescriptorType, Tag
Follow these links for nested inputs and outputs; recursive types link back to the same type page.
Pagination and streaming
No generated paginator for this operation.
No output stream.
Errors
Import from rboto_sts.exceptions:
MalformedPolicyDocumentError, PackedPolicyTooLargeError, RegionDisabledError.
Other service failures use the service base error; credential, transport and timeout failures use shared errors.