STSClient.get_web_identity_token
rboto-sts==0.4.0 · Service index · Types
Model summary (excerpt): Returns a signed JSON Web Token (JWT) that represents the calling Amazon Web Services identity or, if you set SubjectMode to OriginIdentity , the human user or workload on whose behalf the calling session acts. The returned JWT can be used to authenticate with external services that support OIDC discovery. The token is signed by Amazon Web Services STS and can be publicly verified using the...
Install and imports
from rboto import STSClient
from collections.abc import Sequence
from rboto_sts.types import (
GetWebIdentityTokenOutput,
Tag,
webIdentityTokenSubjectModeType,
)
Signature
async def get_web_identity_token(
*,
audience: Sequence[str],
signing_algorithm: str,
duration_seconds: int | None = None,
scope: str | None = None,
subject_mode: webIdentityTokenSubjectModeType | None = None,
tags: Sequence[Tag] | None = None,
) -> GetWebIdentityTokenOutput: ...
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) |
|---|---|---|
audience |
Yes | The intended recipient of the web identity token. This value populates the aud claim in the JWT and should identify the service or application that will validate and use the token. The external service should verify this claim to ensure the token was intended for their use. |
signing_algorithm |
Yes | The cryptographic algorithm to use for signing the JSON Web Token (JWT). Valid values are RS256 (RSA with SHA-256) and ES384 (ECDSA using P-384 curve with SHA-384). |
duration_seconds |
No | The duration, in seconds, for which the JSON Web Token (JWT) will remain valid. The value can range from 60 seconds (1 minute) to 3600 seconds (1 hour). If not specified, the default duration is 300 seconds (5 minutes). The token is designed to be short-lived and should be used for proof of identity, then exchanged for credentials or short-lived tokens in the external service. |
scope |
No | One or more OAuth 2.0 scope values to include in the JSON Web Token (JWT). Amazon Web Services STS copies the value exactly as you send it into the top-level scope claim of the token. If you don't specify Scope , the token doesn't include a scope claim. Separate multiple values with a single space, as defined in RFC 6749, section 3.3 on the IETF website. Don't begin or end Scope with a space.... |
subject_mode |
No | Specifies which identity STS puts in the sub (subject) claim of the JSON Web Token (JWT). Valid values are AWSIdentity and OriginIdentity . If you don't specify a value, Amazon Web Services STS uses AWSIdentity . AWSIdentity – The sub claim contains the ARN of the calling Amazon Web Services principal. OriginIdentity – The sub claim contains the value of the aws:OriginIdentity/Subject key in... |
tags |
No | An optional list of tags to include in the JSON Web Token (JWT). These tags are added as custom claims to the JWT and can be used by the downstream service for authorization decisions. |
Output
GetWebIdentityTokenOutput.
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 |
|---|---|---|---|
web_identity_token |
str | None |
Always present | — |
expiration |
str | 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
GetWebIdentityTokenOutput, Tag, webIdentityTokenSubjectModeType
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:
JWTPayloadSizeExceededError, OutboundWebIdentityFederationDisabledError, SessionDurationEscalationError.
Other service failures use the service base error; credential, transport and timeout failures use shared errors.