get_web_identity_token
async
¶
get_web_identity_token(
audience: webIdentityTokenAudienceListType,
signing_algorithm: jwtAlgorithmType,
*,
config_overrides: Optional[AsyncSTSClientConfig] = None,
duration_seconds: Optional[webIdentityTokenDurationSecondsType] = None,
tags: Optional[tagListType] = None,
) -> GetWebIdentityTokenResponse
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.
The GetWebIdentityToken API is not available on the STS Global endpoint.
Parameters:
-
audience(webIdentityTokenAudienceListType) –The intended recipient of the web identity token. This value populates the
audclaim 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(Optional[webIdentityTokenDurationSecondsType], default: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(jwtAlgorithmType) –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).
-
tags(Optional[tagListType], default:None) –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.
Raises:
-
JWTPayloadSizeExceededException–The requested token payload size exceeds the maximum allowed size. Reduce the number of request tags included in the
GetWebIdentityTokenAPI call to reduce the token payload size. -
OutboundWebIdentityFederationDisabledException–The outbound web identity federation feature is not enabled for this account. To use this feature, you must first enable it through the Amazon Web Services Management Console or API.
-
SessionDurationEscalationException–The requested token duration would extend the session beyond its original expiration time. You cannot use this operation to extend the lifetime of a session beyond what was granted when the session was originally created.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_sts/_services/async_sts.py
1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 | |