pub struct GetWebIdentityTokenFluentBuilder { /* private fields */ }Expand description
Fluent builder constructing a request to GetWebIdentityToken.
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 verification keys published at the issuer's JWKS endpoint.
The sub (subject) claim contains the identity that SubjectMode selects. Whichever subject mode you use, the principal_id claim under the https://sts.amazonaws.com/ namespace contains the ARN of the principal that requested the token, when that principal has an ARN. For a role session, this is the ARN of the role.
The GetWebIdentityToken API is not available on the STS Global endpoint.
Implementations§
Source§impl GetWebIdentityTokenFluentBuilder
impl GetWebIdentityTokenFluentBuilder
Sourcepub fn as_input(&self) -> &GetWebIdentityTokenInputBuilder
pub fn as_input(&self) -> &GetWebIdentityTokenInputBuilder
Access the GetWebIdentityToken as a reference.
Sourcepub async fn send(
self,
) -> Result<GetWebIdentityTokenOutput, SdkError<GetWebIdentityTokenError, HttpResponse>>
pub async fn send( self, ) -> Result<GetWebIdentityTokenOutput, SdkError<GetWebIdentityTokenError, HttpResponse>>
Sends the request and returns the response.
If an error occurs, an SdkError will be returned with additional details that
can be matched against.
By default, any retryable failures will be retried twice. Retry behavior is configurable with the RetryConfig, which can be set when configuring the client.
Sourcepub fn customize(
self,
) -> CustomizableOperation<GetWebIdentityTokenOutput, GetWebIdentityTokenError, Self>
pub fn customize( self, ) -> CustomizableOperation<GetWebIdentityTokenOutput, GetWebIdentityTokenError, Self>
Consumes this builder, creating a customizable operation that can be modified before being sent.
Sourcepub fn audience(self, input: impl Into<String>) -> Self
pub fn audience(self, input: impl Into<String>) -> Self
Appends an item to Audience.
To override the contents of this collection use set_audience.
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.
Sourcepub fn set_audience(self, input: Option<Vec<String>>) -> Self
pub fn set_audience(self, input: Option<Vec<String>>) -> Self
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.
Sourcepub fn get_audience(&self) -> &Option<Vec<String>>
pub fn get_audience(&self) -> &Option<Vec<String>>
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.
Sourcepub fn duration_seconds(self, input: i32) -> Self
pub fn duration_seconds(self, input: i32) -> Self
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.
Sourcepub fn set_duration_seconds(self, input: Option<i32>) -> Self
pub fn set_duration_seconds(self, input: Option<i32>) -> Self
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.
Sourcepub fn get_duration_seconds(&self) -> &Option<i32>
pub fn get_duration_seconds(&self) -> &Option<i32>
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.
Sourcepub fn signing_algorithm(self, input: impl Into<String>) -> Self
pub fn signing_algorithm(self, input: impl Into<String>) -> Self
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).
Sourcepub fn set_signing_algorithm(self, input: Option<String>) -> Self
pub fn set_signing_algorithm(self, input: Option<String>) -> Self
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).
Sourcepub fn get_signing_algorithm(&self) -> &Option<String>
pub fn get_signing_algorithm(&self) -> &Option<String>
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).
Sourcepub fn scope(self, input: impl Into<String>) -> Self
pub fn scope(self, input: impl Into<String>) -> Self
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. Each scope value can contain printable ASCII characters except spaces, double quotation marks ("), commas (,), and backslashes (\).
You can't repeat a scope value. Scope values are case sensitive. This means that read and READ are separate values.
You can specify Scope only when SubjectMode is OriginIdentity and you request exactly one audience. To specify Scope, the calling principal must have permission for the sts:SetWebIdentityTokenScope action in addition to sts:GetWebIdentityToken. You can use the multivalued sts:IdentityTokenScope condition key in a policy to control which scope values a principal can request.
Sourcepub fn set_scope(self, input: Option<String>) -> Self
pub fn set_scope(self, input: Option<String>) -> Self
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. Each scope value can contain printable ASCII characters except spaces, double quotation marks ("), commas (,), and backslashes (\).
You can't repeat a scope value. Scope values are case sensitive. This means that read and READ are separate values.
You can specify Scope only when SubjectMode is OriginIdentity and you request exactly one audience. To specify Scope, the calling principal must have permission for the sts:SetWebIdentityTokenScope action in addition to sts:GetWebIdentityToken. You can use the multivalued sts:IdentityTokenScope condition key in a policy to control which scope values a principal can request.
Sourcepub fn get_scope(&self) -> &Option<String>
pub fn get_scope(&self) -> &Option<String>
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. Each scope value can contain printable ASCII characters except spaces, double quotation marks ("), commas (,), and backslashes (\).
You can't repeat a scope value. Scope values are case sensitive. This means that read and READ are separate values.
You can specify Scope only when SubjectMode is OriginIdentity and you request exactly one audience. To specify Scope, the calling principal must have permission for the sts:SetWebIdentityTokenScope action in addition to sts:GetWebIdentityToken. You can use the multivalued sts:IdentityTokenScope condition key in a policy to control which scope values a principal can request.
Sourcepub fn subject_mode(self, input: WebIdentityTokenSubjectModeType) -> Self
pub fn subject_mode(self, input: WebIdentityTokenSubjectModeType) -> Self
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– Thesubclaim contains the ARN of the calling Amazon Web Services principal. -
OriginIdentity– Thesubclaim contains the value of theaws:OriginIdentity/Subjectkey in the trusted identity propagation context of the calling session. For example, this can identify the human user or workload on whose behalf the calling session acts. Amazon Web Services STS also adds asubject_modeclaim to the token.To use
OriginIdentity, the trusted identity propagation context of the calling session must contain theaws:OriginIdentity/Subjectkey and either theaws:OriginIdentity/Issuerkey or theaws:OriginIdentity/FederatedProviderArnkey. If it doesn't, or if the subject is blank, Amazon Web Services STS rejects the request with a validation error.Amazon Web Services STS denies the request if the subject begins with the text
arn:, in any combination of uppercase and lowercase letters. Amazon Web Services STS also denies the request if the subject begins or ends with a space, or contains a control, format, or separator character other than a space.
You can use the sts:SubjectMode condition key in a policy to control which subject modes a principal can request.
Sourcepub fn set_subject_mode(
self,
input: Option<WebIdentityTokenSubjectModeType>,
) -> Self
pub fn set_subject_mode( self, input: Option<WebIdentityTokenSubjectModeType>, ) -> Self
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– Thesubclaim contains the ARN of the calling Amazon Web Services principal. -
OriginIdentity– Thesubclaim contains the value of theaws:OriginIdentity/Subjectkey in the trusted identity propagation context of the calling session. For example, this can identify the human user or workload on whose behalf the calling session acts. Amazon Web Services STS also adds asubject_modeclaim to the token.To use
OriginIdentity, the trusted identity propagation context of the calling session must contain theaws:OriginIdentity/Subjectkey and either theaws:OriginIdentity/Issuerkey or theaws:OriginIdentity/FederatedProviderArnkey. If it doesn't, or if the subject is blank, Amazon Web Services STS rejects the request with a validation error.Amazon Web Services STS denies the request if the subject begins with the text
arn:, in any combination of uppercase and lowercase letters. Amazon Web Services STS also denies the request if the subject begins or ends with a space, or contains a control, format, or separator character other than a space.
You can use the sts:SubjectMode condition key in a policy to control which subject modes a principal can request.
Sourcepub fn get_subject_mode(&self) -> &Option<WebIdentityTokenSubjectModeType>
pub fn get_subject_mode(&self) -> &Option<WebIdentityTokenSubjectModeType>
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– Thesubclaim contains the ARN of the calling Amazon Web Services principal. -
OriginIdentity– Thesubclaim contains the value of theaws:OriginIdentity/Subjectkey in the trusted identity propagation context of the calling session. For example, this can identify the human user or workload on whose behalf the calling session acts. Amazon Web Services STS also adds asubject_modeclaim to the token.To use
OriginIdentity, the trusted identity propagation context of the calling session must contain theaws:OriginIdentity/Subjectkey and either theaws:OriginIdentity/Issuerkey or theaws:OriginIdentity/FederatedProviderArnkey. If it doesn't, or if the subject is blank, Amazon Web Services STS rejects the request with a validation error.Amazon Web Services STS denies the request if the subject begins with the text
arn:, in any combination of uppercase and lowercase letters. Amazon Web Services STS also denies the request if the subject begins or ends with a space, or contains a control, format, or separator character other than a space.
You can use the sts:SubjectMode condition key in a policy to control which subject modes a principal can request.
Appends an item to Tags.
To override the contents of this collection use set_tags.
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.
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.
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.
Trait Implementations§
Source§impl Clone for GetWebIdentityTokenFluentBuilder
impl Clone for GetWebIdentityTokenFluentBuilder
Source§fn clone(&self) -> GetWebIdentityTokenFluentBuilder
fn clone(&self) -> GetWebIdentityTokenFluentBuilder
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for GetWebIdentityTokenFluentBuilder
impl !UnwindSafe for GetWebIdentityTokenFluentBuilder
impl Freeze for GetWebIdentityTokenFluentBuilder
impl Send for GetWebIdentityTokenFluentBuilder
impl Sync for GetWebIdentityTokenFluentBuilder
impl Unpin for GetWebIdentityTokenFluentBuilder
impl UnsafeUnpin for GetWebIdentityTokenFluentBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more