CognitoIdentityClient.get_credentials_for_identity
rboto-cognito-identity==0.4.0 · Service index · Types
Model summary (excerpt): 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.
Install and imports
from rboto import CognitoIdentityClient
from rboto_cognito_identity.types import (
GetCredentialsForIdentityOutput,
)
Signature
async def get_credentials_for_identity(
*,
identity_id: str,
logins: dict[str, str] | None = None,
custom_role_arn: str | None = None,
) -> GetCredentialsForIdentityOutput: ...
Arguments without defaults are required. None omits an optional request argument. Static types do not validate resource existence, permissions, lengths, ranges, or conditional service requirements.
Arguments
| Argument | Required | Model notes (excerpt) |
|---|---|---|
identity_id |
Yes | A unique identifier in the format REGION:GUID. |
logins |
No | 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... |
custom_role_arn |
No | 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. |
Output
GetCredentialsForIdentityOutput.
Read-only native attributes, accessed as response.field. Collection getters materialize Python values; to_dict() recursively materializes a mapping. Streams are consumed once.
| Field | Type | Presence | References |
|---|---|---|---|
identity_id |
str | None |
Always present | — |
credentials |
CredentialsOutput | None |
Always present | CredentialsOutput |
| None means a value can be absent. Output mappings include every declared key; optional input keys may be omitted. Unknown output enum/union variants are not automatically valid inputs.
Related types
GetCredentialsForIdentityOutput
Follow these links for nested inputs and outputs; recursive types link back to the same type page.
Pagination and streaming
No generated paginator for this operation.
No output stream.
Errors
Import from rboto_cognito_identity.exceptions:
ExternalServiceError, InternalError, InvalidIdentityPoolConfigurationError, InvalidParameterError, NotAuthorizedError, ResourceConflictError, ResourceNotFoundError, TooManyRequestsError.
Other service failures use the service base error; credential, transport and timeout failures use shared errors.