Class: Aws::STS::Types::GetWebIdentityTokenRequest

Inherits:
Struct
  • Object
show all
Defined in:
gems/aws-sdk-core/lib/aws-sdk-sts/types.rb

Overview

Constant Summary collapse

SENSITIVE =
[]

Instance Attribute Summary collapse

Instance Attribute Details

#audience ⇒ Array<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.

If you set TokenType to JWT_SVID, you must specify exactly one audience.

Returns:

  • (Array<String>)


2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
# File 'gems/aws-sdk-core/lib/aws-sdk-sts/types.rb', line 2073

class GetWebIdentityTokenRequest < Struct.new(
  :audience,
  :duration_seconds,
  :signing_algorithm,
  :scope,
  :subject_mode,
  :tags,
  :token_type)
  SENSITIVE = []
  include Aws::Structure
end

#duration_seconds ⇒ Integer

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.

The token can't remain valid after the calling session expires. If the requested duration ends after the calling session expires, Amazon Web Services STS rejects the request with SessionDurationEscalationException. This applies to both token types. A certificate from GetCertificate, in contrast, can remain valid after the session that requested it expires.

Returns:

  • (Integer)


2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
# File 'gems/aws-sdk-core/lib/aws-sdk-sts/types.rb', line 2073

class GetWebIdentityTokenRequest < Struct.new(
  :audience,
  :duration_seconds,
  :signing_algorithm,
  :scope,
  :subject_mode,
  :tags,
  :token_type)
  SENSITIVE = []
  include Aws::Structure
end

#scope ⇒ 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.

Scope and TokenType are mutually exclusive. If you specify both, Amazon Web Services STS rejects the request with a validation error, whichever value of TokenType you specify.

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.

Returns:

  • (String)


2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
# File 'gems/aws-sdk-core/lib/aws-sdk-sts/types.rb', line 2073

class GetWebIdentityTokenRequest < Struct.new(
  :audience,
  :duration_seconds,
  :signing_algorithm,
  :scope,
  :subject_mode,
  :tags,
  :token_type)
  SENSITIVE = []
  include Aws::Structure
end

#signing_algorithm ⇒ 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). You can use either algorithm with both token types, AWSIdentity and JWT_SVID.

Returns:

  • (String)


2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
# File 'gems/aws-sdk-core/lib/aws-sdk-sts/types.rb', line 2073

class GetWebIdentityTokenRequest < Struct.new(
  :audience,
  :duration_seconds,
  :signing_algorithm,
  :scope,
  :subject_mode,
  :tags,
  :token_type)
  SENSITIVE = []
  include Aws::Structure
end

#subject_mode ⇒ String

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.

SubjectMode and TokenType are mutually exclusive. If you specify both, Amazon Web Services STS rejects the request with a validation error, whichever value of TokenType you specify.

  • 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 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 a subject_mode claim to the token.

    To use OriginIdentity, the trusted identity propagation context of the calling session must contain the aws:OriginIdentity/Subject key and either the aws:OriginIdentity/Issuer key or the aws:OriginIdentity/FederatedProviderArn key. 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.

Returns:

  • (String)


2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
# File 'gems/aws-sdk-core/lib/aws-sdk-sts/types.rb', line 2073

class GetWebIdentityTokenRequest < Struct.new(
  :audience,
  :duration_seconds,
  :signing_algorithm,
  :scope,
  :subject_mode,
  :tags,
  :token_type)
  SENSITIVE = []
  include Aws::Structure
end

#tags ⇒ Array<Types::Tag>

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.

You can't specify Tags if you set TokenType to JWT_SVID.

Returns:



2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
# File 'gems/aws-sdk-core/lib/aws-sdk-sts/types.rb', line 2073

class GetWebIdentityTokenRequest < Struct.new(
  :audience,
  :duration_seconds,
  :signing_algorithm,
  :scope,
  :subject_mode,
  :tags,
  :token_type)
  SENSITIVE = []
  include Aws::Structure
end

#token_type ⇒ String

The type of token to return. Valid values are AWSIdentity and JWT_SVID. If you don't specify a value, Amazon Web Services STS uses AWSIdentity. Each value returns the following type of token:

AWSIdentity

A JSON Web Token (JWT) that represents the calling Amazon Web Services identity. You can verify it with the keys at the issuer's JSON Web Key Set (JWKS) endpoint.

JWT_SVID

A JWT SPIFFE Verifiable Identity Document (JWT-SVID) for the workload identity of the calling session. You can request a JWT-SVID only with temporary credentials for a role session that has a workload identity, and the workload identity provider must use the SPIFFE naming scheme. Amazon Web Services STS sets the sub claim to the SPIFFE ID of the workload and the iss claim from the workload identity provider. You can't set either value in the request. You can verify a JWT-SVID through OIDC discovery from its iss claim, or with the trust bundle that GetTrustBundles returns.

With JWT_SVID, you must specify exactly one audience, and you can't specify Tags.

TokenType is mutually exclusive with SubjectMode and Scope. If you specify TokenType, with either value, and also specify SubjectMode or Scope, Amazon Web Services STS rejects the request with a validation error.

You can use the sts:TokenType condition key in a policy to control which token types a principal can request.

Returns:

  • (String)


2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
# File 'gems/aws-sdk-core/lib/aws-sdk-sts/types.rb', line 2073

class GetWebIdentityTokenRequest < Struct.new(
  :audience,
  :duration_seconds,
  :signing_algorithm,
  :scope,
  :subject_mode,
  :tags,
  :token_type)
  SENSITIVE = []
  include Aws::Structure
end