Skip to content

create_o_auth2_token_with_iam

Operation

create_o_auth2_token_with_iam

create_o_auth2_token_with_iam(request: CreateOAuth2TokenWithIAMInput | CreateOAuth2TokenWithIAMInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[CreateOAuth2TokenWithIAMInputDict]) -> CreateOAuth2TokenWithIAMOutput

Exchanges client credentials for an OAuth 2.0 access token scoped to a resource, which you can use to access AWS services from applications.

Parameters:

Name Type Description Default
request CreateOAuth2TokenWithIAMInput | CreateOAuth2TokenWithIAMInputDict | 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[CreateOAuth2TokenWithIAMInputDict]

The input fields as keyword arguments.

{}

Returns:

Type Description
CreateOAuth2TokenWithIAMOutput

An instance of CreateOAuth2TokenWithIAMOutput.

create_o_auth2_token_with_iam async

create_o_auth2_token_with_iam(request: CreateOAuth2TokenWithIAMInput | CreateOAuth2TokenWithIAMInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[CreateOAuth2TokenWithIAMInputDict]) -> CreateOAuth2TokenWithIAMOutput

Exchanges client credentials for an OAuth 2.0 access token scoped to a resource, which you can use to access AWS services from applications.

Parameters:

Name Type Description Default
request CreateOAuth2TokenWithIAMInput | CreateOAuth2TokenWithIAMInputDict | 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[CreateOAuth2TokenWithIAMInputDict]

The input fields as keyword arguments.

{}

Returns:

Type Description
CreateOAuth2TokenWithIAMOutput

An instance of CreateOAuth2TokenWithIAMOutput.

Input

Pass the input as keyword arguments, a positional dictionary, or a positional model object. Pass plugins separately as a keyword argument.

CreateOAuth2TokenWithIAMInputDict

Bases: TypedDict

Dictionary form of CreateOAuth2TokenWithIAMInput.

Attributes

grant_type instance-attribute
grant_type: Required[str]

The OAuth 2.0 grant type. Must be "client_credentials".

resource instance-attribute
resource: Required[str]

The OAuth resource for which the access token is requested. Example: "aws-mcp.amazonaws.com".

CreateOAuth2TokenWithIAMInput dataclass

Bases: _SerdeShape

Input structure for CreateOAuth2TokenWithIAM operation

Attributes

grant_type class-attribute instance-attribute
grant_type: str | None = ...

The OAuth 2.0 grant type. Must be "client_credentials".

resource class-attribute instance-attribute
resource: str | None = ...

The OAuth resource for which the access token is requested. Example: "aws-mcp.amazonaws.com".

Output

CreateOAuth2TokenWithIAMOutput dataclass

Bases: _SerdeShape

Output structure for CreateOAuth2TokenWithIAM operation Contains the access token, token type, and expiration as defined in RFC 6749 ยง5.1.

Attributes

access_token instance-attribute
access_token: str

Access token containing principal identity, resource scope, and session metadata.

expires_in instance-attribute
expires_in: int

Token lifetime in seconds. Value is the minimum of the caller's session validity and 1 hour (3600 seconds).

response_metadata class-attribute instance-attribute
response_metadata: ResponseMetadata = ...

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.

token_type instance-attribute
token_type: str

The token type. Always "Bearer" as defined in RFC 6749.