Skip to content

get_credentials_for_identity

Operation

get_credentials_for_identity

get_credentials_for_identity(request: GetCredentialsForIdentityInput | GetCredentialsForIdentityInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[GetCredentialsForIdentityInputDict]) -> GetCredentialsForIdentityOutput

Returns credentials for the provided identity ID. Any provided logins will be validated against supported login providers. If the token is for cognito-identity.amazonaws.com, it will be passed through to Security Token Service with the appropriate role for the token.

This is a public API. You do not need any credentials to call this API.

Parameters:

Name Type Description Default
request GetCredentialsForIdentityInput | GetCredentialsForIdentityInputDict | 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[GetCredentialsForIdentityInputDict]

The input fields as keyword arguments.

{}

Returns:

Type Description
GetCredentialsForIdentityOutput

An instance of GetCredentialsForIdentityOutput.

get_credentials_for_identity async

get_credentials_for_identity(request: GetCredentialsForIdentityInput | GetCredentialsForIdentityInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[GetCredentialsForIdentityInputDict]) -> GetCredentialsForIdentityOutput

Returns credentials for the provided identity ID. Any provided logins will be validated against supported login providers. If the token is for cognito-identity.amazonaws.com, it will be passed through to Security Token Service with the appropriate role for the token.

This is a public API. You do not need any credentials to call this API.

Parameters:

Name Type Description Default
request GetCredentialsForIdentityInput | GetCredentialsForIdentityInputDict | 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[GetCredentialsForIdentityInputDict]

The input fields as keyword arguments.

{}

Returns:

Type Description
GetCredentialsForIdentityOutput

An instance of GetCredentialsForIdentityOutput.

Input

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

GetCredentialsForIdentityInputDict

Bases: TypedDict

Dictionary form of GetCredentialsForIdentityInput.

Attributes

custom_role_arn instance-attribute
custom_role_arn: str | None

The Amazon Resource Name (ARN) of the role to be assumed when multiple roles were received in the token from the identity provider. For example, a SAML-based identity provider. This parameter is optional for identity providers that do not support role customization.

identity_id instance-attribute
identity_id: Required[str]

A unique identifier in the format REGION:GUID.

logins instance-attribute
logins: Mapping[str, str] | None

A set of optional name-value pairs that map provider names to provider tokens. The name-value pair will follow the syntax "provider_name": "provider_user_identifier".

Logins should not be specified when trying to get credentials for an unauthenticated identity.

The Logins parameter is required when using identities associated with external identity providers such as Facebook. For examples of Logins maps, see the code examples in the External Identity Providers section of the Amazon Cognito Developer Guide.

GetCredentialsForIdentityInput dataclass

Bases: _SerdeShape

Input to the GetCredentialsForIdentity action.

Attributes

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

The Amazon Resource Name (ARN) of the role to be assumed when multiple roles were received in the token from the identity provider. For example, a SAML-based identity provider. This parameter is optional for identity providers that do not support role customization.

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

A unique identifier in the format REGION:GUID.

logins class-attribute instance-attribute
logins: dict[str, str] | None = ...

A set of optional name-value pairs that map provider names to provider tokens. The name-value pair will follow the syntax "provider_name": "provider_user_identifier".

Logins should not be specified when trying to get credentials for an unauthenticated identity.

The Logins parameter is required when using identities associated with external identity providers such as Facebook. For examples of Logins maps, see the code examples in the External Identity Providers section of the Amazon Cognito Developer Guide.

Output

GetCredentialsForIdentityOutput dataclass

Bases: _SerdeShape

Returned in response to a successful GetCredentialsForIdentity operation.

Attributes

credentials class-attribute instance-attribute
credentials: Credentials | None = ...

Credentials for the provided identity ID.

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

A unique identifier in the format REGION:GUID.

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.