Skip to content

STSClient.assume_role_with_saml

rboto-sts==0.4.0 · Service index · Types

Model summary (excerpt): 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 Amazon Web Services access without user-specific credentials or configuration. For a comparison of AssumeRoleWithSAML with the other API operations that produce temporary...

Install and imports

python -m pip install "rboto[sts]==0.4.0"
from rboto import STSClient
from collections.abc import Sequence
from rboto_sts.types import (
    AssumeRoleWithSAMLOutput,
    PolicyDescriptorType,
)

Signature

async def assume_role_with_saml(
    *,
    role_arn: str,
    principal_arn: str,
    saml_assertion: str,
    policy_arns: Sequence[PolicyDescriptorType] | None = None,
    policy: str | None = None,
    duration_seconds: int | None = None,
    minimum_session_token_size: int | None = None,
) -> AssumeRoleWithSAMLOutput: ...

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)
role_arn Yes The Amazon Resource Name (ARN) of the role that the caller is assuming.
principal_arn Yes The Amazon Resource Name (ARN) of the SAML provider in IAM that describes the IdP.
saml_assertion Yes The base64 encoded SAML authentication response provided by the IdP. For more information, see Configuring a Relying Party and Adding Claims in the IAM User Guide .
policy_arns No The Amazon Resource Names (ARNs) of the IAM managed policies that you want to use as managed session policies. The policies must exist in the same account as the role. This parameter is optional. You can provide up to 10 managed policy ARNs. However, the plaintext that you use for both inline and managed session policies can't exceed 2,048 characters. For more information about ARNs, see...
policy No An IAM policy in JSON format that you want to use as an inline session policy. This parameter is optional. Passing policies to this operation returns new temporary credentials. The resulting session's permissions are the intersection of the role's identity-based policy and the session policies. You can use the role's temporary credentials in subsequent Amazon Web Services API calls to access...
duration_seconds No The duration, in seconds, of the role session. Your role session lasts for the duration that you specify for the DurationSeconds parameter, or until the time specified in the SAML authentication response's SessionNotOnOrAfter value, whichever is shorter. You can provide a DurationSeconds value from 900 seconds (15 minutes) up to the maximum session duration setting for the role. This setting...
minimum_session_token_size No

Output

AssumeRoleWithSAMLOutput.

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
assumed_role_user AssumedRoleUserOutput | None Always present AssumedRoleUserOutput
packed_policy_size int | None Always present —
subject str | None Always present —
subject_type str | None Always present —
issuer str | None Always present —
audience str | None Always present —
name_qualifier str | None Always present —
source_identity str | None Always present —
session_token_utilization int | None Always present —
session_token_size int | None Always present —
trusted_identity_propagation_context TrustedIdentityPropagationContextOutput | None Always present TrustedIdentityPropagationContextOutput

| 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.

AssumeRoleWithSAMLOutput, PolicyDescriptorType

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:

ExpiredTokenError, IDPRejectedClaimError, InvalidIdentityTokenError, MalformedPolicyDocumentError, PackedPolicyTooLargeError, RegionDisabledError.

Other service failures use the service base error; credential, transport and timeout failures use shared errors.

Service guide · Pinned model