get_web_identity_token¶
Operation¶
get_web_identity_token
¶
get_web_identity_token(request: GetWebIdentityTokenInput | GetWebIdentityTokenInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[GetWebIdentityTokenInputDict]) -> GetWebIdentityTokenOutput
Returns a signed JSON Web Token (JWT) that represents the calling Amazon Web Services identity. 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 verification keys published at the issuer's JWKS endpoint.
Note
The GetWebIdentityToken API is not available on the STS Global
endpoint.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
GetWebIdentityTokenInput | GetWebIdentityTokenInputDict | None
|
The input as a model or dictionary. Pass this or keyword arguments, not both. |
None
|
plugins
|
list[Plugin] | None
|
A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations. |
None
|
**kwargs
|
Unpack[GetWebIdentityTokenInputDict]
|
The input fields as keyword arguments. |
{}
|
Returns:
| Type | Description |
|---|---|
GetWebIdentityTokenOutput
|
An instance of |
get_web_identity_token
async
¶
get_web_identity_token(request: GetWebIdentityTokenInput | GetWebIdentityTokenInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[GetWebIdentityTokenInputDict]) -> GetWebIdentityTokenOutput
Returns a signed JSON Web Token (JWT) that represents the calling Amazon Web Services identity. 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 verification keys published at the issuer's JWKS endpoint.
Note
The GetWebIdentityToken API is not available on the STS Global
endpoint.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
GetWebIdentityTokenInput | GetWebIdentityTokenInputDict | None
|
The input as a model or dictionary. Pass this or keyword arguments, not both. |
None
|
plugins
|
list[Plugin] | None
|
A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations. |
None
|
**kwargs
|
Unpack[GetWebIdentityTokenInputDict]
|
The input fields as keyword arguments. |
{}
|
Returns:
| Type | Description |
|---|---|
GetWebIdentityTokenOutput
|
An instance of |
Input¶
Pass the input as keyword arguments, a positional dictionary, or a positional model object. Pass plugins separately as a keyword argument.
GetWebIdentityTokenInputDict
¶
Bases: TypedDict
Dictionary form of GetWebIdentityTokenInput.
Attributes¶
audience
instance-attribute
¶
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.
duration_seconds
instance-attribute
¶
duration_seconds: int | None
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.
signing_algorithm
instance-attribute
¶
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).
GetWebIdentityTokenInput
dataclass
¶
Bases: _SerdeShape
Dataclass for GetWebIdentityTokenInput structure.
Attributes¶
audience
class-attribute
instance-attribute
¶
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.
duration_seconds
class-attribute
instance-attribute
¶
duration_seconds: int | None = ...
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.
Output¶
GetWebIdentityTokenOutput
dataclass
¶
Bases: _SerdeShape
Dataclass for GetWebIdentityTokenOutput structure.
Attributes¶
expiration
class-attribute
instance-attribute
¶
expiration: datetime | None = ...
The date and time when the web identity token expires, in UTC. The
expiration is determined by adding the DurationSeconds value to the
time the token was issued. After this time, the token should no longer
be considered valid.
response_metadata
class-attribute
instance-attribute
¶
Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.
web_identity_token
class-attribute
instance-attribute
¶
web_identity_token: str | None = ...
A signed JSON Web Token (JWT) that represents the caller's Amazon Web
Services identity. The token contains standard JWT claims such as
subject, audience, expiration time, and additional identity attributes
added by STS as custom claims. You can also add your own custom claims
to the token by passing tags as request parameters to the
GetWebIdentityToken API. The token is signed using the specified
signing algorithm and can be verified using the verification keys
available at the issuer's JWKS endpoint.