Skip to content

CognitoIdentityClient

Index > CognitoIdentity > CognitoIdentityClient

Auto-generated documentation for CognitoIdentity type annotations stubs module mypy-boto3-cognito-identity.

CognitoIdentityClient

Type annotations and code completion for boto3.client("cognito-identity"). boto3 documentation

Usage example
from boto3.session import Session
from mypy_boto3_cognito_identity.client import CognitoIdentityClient

def get_cognito-identity_client() -> CognitoIdentityClient:
    return Session().client("cognito-identity")

Exceptions

boto3 client exceptions are generated in runtime. This class provides code completion for boto3.client("cognito-identity").exceptions structure.

Usage example
client = boto3.client("cognito-identity")

try:
    do_something(client)
except (
    client.ClientError,
    client.ConcurrentModificationException,
    client.DeveloperUserAlreadyRegisteredException,
    client.ExternalServiceException,
    client.InternalErrorException,
    client.InvalidIdentityPoolConfigurationException,
    client.InvalidParameterException,
    client.LimitExceededException,
    client.NotAuthorizedException,
    client.ResourceConflictException,
    client.ResourceNotFoundException,
    client.TooManyRequestsException,
) as e:
    print(e)
Type checking example
from mypy_boto3_cognito_identity.client import Exceptions

def handle_error(exc: Exceptions.ClientError) -> None:
    ...

Methods

can_paginate

Check if an operation can be paginated.

Type annotations and code completion for boto3.client("cognito-identity").can_paginate method. boto3 documentation

Method definition
def can_paginate(
    self,
    operation_name: str,
) -> bool:
    ...

close

Closes underlying endpoint connections.

Type annotations and code completion for boto3.client("cognito-identity").close method. boto3 documentation

Method definition
def close(
    self,
) -> None:
    ...

create_identity_pool

Creates a new identity pool.

Type annotations and code completion for boto3.client("cognito-identity").create_identity_pool method. boto3 documentation

Method definition
def create_identity_pool(
    self,
    *,
    IdentityPoolName: str,
    AllowUnauthenticatedIdentities: bool,
    AllowClassicFlow: bool = ...,
    SupportedLoginProviders: Mapping[str, str] = ...,
    DeveloperProviderName: str = ...,
    OpenIdConnectProviderARNs: Sequence[str] = ...,
    CognitoIdentityProviders: Sequence[CognitoIdentityProviderTypeDef] = ...,  # (1)
    SamlProviderARNs: Sequence[str] = ...,
    IdentityPoolTags: Mapping[str, str] = ...,
) -> IdentityPoolTypeDef:  # (2)
    ...
  1. See CognitoIdentityProviderTypeDef
  2. See IdentityPoolTypeDef
Usage example with kwargs
kwargs: CreateIdentityPoolInputRequestTypeDef = {  # (1)
    "IdentityPoolName": ...,
    "AllowUnauthenticatedIdentities": ...,
}

parent.create_identity_pool(**kwargs)
  1. See CreateIdentityPoolInputRequestTypeDef

delete_identities

Deletes identities from an identity pool.

Type annotations and code completion for boto3.client("cognito-identity").delete_identities method. boto3 documentation

Method definition
def delete_identities(
    self,
    *,
    IdentityIdsToDelete: Sequence[str],
) -> DeleteIdentitiesResponseTypeDef:  # (1)
    ...
  1. See DeleteIdentitiesResponseTypeDef
Usage example with kwargs
kwargs: DeleteIdentitiesInputRequestTypeDef = {  # (1)
    "IdentityIdsToDelete": ...,
}

parent.delete_identities(**kwargs)
  1. See DeleteIdentitiesInputRequestTypeDef

delete_identity_pool

Deletes an identity pool.

Type annotations and code completion for boto3.client("cognito-identity").delete_identity_pool method. boto3 documentation

Method definition
def delete_identity_pool(
    self,
    *,
    IdentityPoolId: str,
) -> EmptyResponseMetadataTypeDef:  # (1)
    ...
  1. See EmptyResponseMetadataTypeDef
Usage example with kwargs
kwargs: DeleteIdentityPoolInputRequestTypeDef = {  # (1)
    "IdentityPoolId": ...,
}

parent.delete_identity_pool(**kwargs)
  1. See DeleteIdentityPoolInputRequestTypeDef

describe_identity

Returns metadata related to the given identity, including when the identity was created and any associated linked logins.

Type annotations and code completion for boto3.client("cognito-identity").describe_identity method. boto3 documentation

Method definition
def describe_identity(
    self,
    *,
    IdentityId: str,
) -> IdentityDescriptionResponseMetadataTypeDef:  # (1)
    ...
  1. See IdentityDescriptionResponseMetadataTypeDef
Usage example with kwargs
kwargs: DescribeIdentityInputRequestTypeDef = {  # (1)
    "IdentityId": ...,
}

parent.describe_identity(**kwargs)
  1. See DescribeIdentityInputRequestTypeDef

describe_identity_pool

Gets details about a particular identity pool, including the pool name, ID description, creation date, and current number of users.

Type annotations and code completion for boto3.client("cognito-identity").describe_identity_pool method. boto3 documentation

Method definition
def describe_identity_pool(
    self,
    *,
    IdentityPoolId: str,
) -> IdentityPoolTypeDef:  # (1)
    ...
  1. See IdentityPoolTypeDef
Usage example with kwargs
kwargs: DescribeIdentityPoolInputRequestTypeDef = {  # (1)
    "IdentityPoolId": ...,
}

parent.describe_identity_pool(**kwargs)
  1. See DescribeIdentityPoolInputRequestTypeDef

generate_presigned_url

Generate a presigned url given a client, its method, and arguments.

Type annotations and code completion for boto3.client("cognito-identity").generate_presigned_url method. boto3 documentation

Method definition
def generate_presigned_url(
    self,
    ClientMethod: str,
    Params: Mapping[str, Any] = ...,
    ExpiresIn: int = 3600,
    HttpMethod: str = ...,
) -> str:
    ...

get_credentials_for_identity

Returns credentials for the provided identity ID.

Type annotations and code completion for boto3.client("cognito-identity").get_credentials_for_identity method. boto3 documentation

Method definition
def get_credentials_for_identity(
    self,
    *,
    IdentityId: str,
    Logins: Mapping[str, str] = ...,
    CustomRoleArn: str = ...,
) -> GetCredentialsForIdentityResponseTypeDef:  # (1)
    ...
  1. See GetCredentialsForIdentityResponseTypeDef
Usage example with kwargs
kwargs: GetCredentialsForIdentityInputRequestTypeDef = {  # (1)
    "IdentityId": ...,
}

parent.get_credentials_for_identity(**kwargs)
  1. See GetCredentialsForIdentityInputRequestTypeDef

get_id

Generates (or retrieves) a Cognito ID.

Type annotations and code completion for boto3.client("cognito-identity").get_id method. boto3 documentation

Method definition
def get_id(
    self,
    *,
    IdentityPoolId: str,
    AccountId: str = ...,
    Logins: Mapping[str, str] = ...,
) -> GetIdResponseTypeDef:  # (1)
    ...
  1. See GetIdResponseTypeDef
Usage example with kwargs
kwargs: GetIdInputRequestTypeDef = {  # (1)
    "IdentityPoolId": ...,
}

parent.get_id(**kwargs)
  1. See GetIdInputRequestTypeDef

get_identity_pool_roles

Gets the roles for an identity pool.

Type annotations and code completion for boto3.client("cognito-identity").get_identity_pool_roles method. boto3 documentation

Method definition
def get_identity_pool_roles(
    self,
    *,
    IdentityPoolId: str,
) -> GetIdentityPoolRolesResponseTypeDef:  # (1)
    ...
  1. See GetIdentityPoolRolesResponseTypeDef
Usage example with kwargs
kwargs: GetIdentityPoolRolesInputRequestTypeDef = {  # (1)
    "IdentityPoolId": ...,
}

parent.get_identity_pool_roles(**kwargs)
  1. See GetIdentityPoolRolesInputRequestTypeDef

get_open_id_token

Gets an OpenID token, using a known Cognito ID.

Type annotations and code completion for boto3.client("cognito-identity").get_open_id_token method. boto3 documentation

Method definition
def get_open_id_token(
    self,
    *,
    IdentityId: str,
    Logins: Mapping[str, str] = ...,
) -> GetOpenIdTokenResponseTypeDef:  # (1)
    ...
  1. See GetOpenIdTokenResponseTypeDef
Usage example with kwargs
kwargs: GetOpenIdTokenInputRequestTypeDef = {  # (1)
    "IdentityId": ...,
}

parent.get_open_id_token(**kwargs)
  1. See GetOpenIdTokenInputRequestTypeDef

get_open_id_token_for_developer_identity

Registers (or retrieves) a Cognito IdentityId and an OpenID Connect token for a user authenticated by your backend authentication process.

Type annotations and code completion for boto3.client("cognito-identity").get_open_id_token_for_developer_identity method. boto3 documentation

Method definition
def get_open_id_token_for_developer_identity(
    self,
    *,
    IdentityPoolId: str,
    Logins: Mapping[str, str],
    IdentityId: str = ...,
    PrincipalTags: Mapping[str, str] = ...,
    TokenDuration: int = ...,
) -> GetOpenIdTokenForDeveloperIdentityResponseTypeDef:  # (1)
    ...
  1. See GetOpenIdTokenForDeveloperIdentityResponseTypeDef
Usage example with kwargs
kwargs: GetOpenIdTokenForDeveloperIdentityInputRequestTypeDef = {  # (1)
    "IdentityPoolId": ...,
    "Logins": ...,
}

parent.get_open_id_token_for_developer_identity(**kwargs)
  1. See GetOpenIdTokenForDeveloperIdentityInputRequestTypeDef

get_principal_tag_attribute_map

Use GetPrincipalTagAttributeMap to list all mappings between PrincipalTags and user attributes.

Type annotations and code completion for boto3.client("cognito-identity").get_principal_tag_attribute_map method. boto3 documentation

Method definition
def get_principal_tag_attribute_map(
    self,
    *,
    IdentityPoolId: str,
    IdentityProviderName: str,
) -> GetPrincipalTagAttributeMapResponseTypeDef:  # (1)
    ...
  1. See GetPrincipalTagAttributeMapResponseTypeDef
Usage example with kwargs
kwargs: GetPrincipalTagAttributeMapInputRequestTypeDef = {  # (1)
    "IdentityPoolId": ...,
    "IdentityProviderName": ...,
}

parent.get_principal_tag_attribute_map(**kwargs)
  1. See GetPrincipalTagAttributeMapInputRequestTypeDef

list_identities

Lists the identities in an identity pool.

Type annotations and code completion for boto3.client("cognito-identity").list_identities method. boto3 documentation

Method definition
def list_identities(
    self,
    *,
    IdentityPoolId: str,
    MaxResults: int,
    NextToken: str = ...,
    HideDisabled: bool = ...,
) -> ListIdentitiesResponseTypeDef:  # (1)
    ...
  1. See ListIdentitiesResponseTypeDef
Usage example with kwargs
kwargs: ListIdentitiesInputRequestTypeDef = {  # (1)
    "IdentityPoolId": ...,
    "MaxResults": ...,
}

parent.list_identities(**kwargs)
  1. See ListIdentitiesInputRequestTypeDef

list_identity_pools

Lists all of the Cognito identity pools registered for your account.

Type annotations and code completion for boto3.client("cognito-identity").list_identity_pools method. boto3 documentation

Method definition
def list_identity_pools(
    self,
    *,
    MaxResults: int,
    NextToken: str = ...,
) -> ListIdentityPoolsResponseTypeDef:  # (1)
    ...
  1. See ListIdentityPoolsResponseTypeDef
Usage example with kwargs
kwargs: ListIdentityPoolsInputRequestTypeDef = {  # (1)
    "MaxResults": ...,
}

parent.list_identity_pools(**kwargs)
  1. See ListIdentityPoolsInputRequestTypeDef

list_tags_for_resource

Lists the tags that are assigned to an Amazon Cognito identity pool.

Type annotations and code completion for boto3.client("cognito-identity").list_tags_for_resource method. boto3 documentation

Method definition
def list_tags_for_resource(
    self,
    *,
    ResourceArn: str,
) -> ListTagsForResourceResponseTypeDef:  # (1)
    ...
  1. See ListTagsForResourceResponseTypeDef
Usage example with kwargs
kwargs: ListTagsForResourceInputRequestTypeDef = {  # (1)
    "ResourceArn": ...,
}

parent.list_tags_for_resource(**kwargs)
  1. See ListTagsForResourceInputRequestTypeDef

lookup_developer_identity

Retrieves the IdentityID associated with a DeveloperUserIdentifier or the list of DeveloperUserIdentifier values associated with an IdentityId for an existing identity.

Type annotations and code completion for boto3.client("cognito-identity").lookup_developer_identity method. boto3 documentation

Method definition
def lookup_developer_identity(
    self,
    *,
    IdentityPoolId: str,
    IdentityId: str = ...,
    DeveloperUserIdentifier: str = ...,
    MaxResults: int = ...,
    NextToken: str = ...,
) -> LookupDeveloperIdentityResponseTypeDef:  # (1)
    ...
  1. See LookupDeveloperIdentityResponseTypeDef
Usage example with kwargs
kwargs: LookupDeveloperIdentityInputRequestTypeDef = {  # (1)
    "IdentityPoolId": ...,
}

parent.lookup_developer_identity(**kwargs)
  1. See LookupDeveloperIdentityInputRequestTypeDef

merge_developer_identities

Merges two users having different IdentityId s, existing in the same identity pool, and identified by the same developer provider.

Type annotations and code completion for boto3.client("cognito-identity").merge_developer_identities method. boto3 documentation

Method definition
def merge_developer_identities(
    self,
    *,
    SourceUserIdentifier: str,
    DestinationUserIdentifier: str,
    DeveloperProviderName: str,
    IdentityPoolId: str,
) -> MergeDeveloperIdentitiesResponseTypeDef:  # (1)
    ...
  1. See MergeDeveloperIdentitiesResponseTypeDef
Usage example with kwargs
kwargs: MergeDeveloperIdentitiesInputRequestTypeDef = {  # (1)
    "SourceUserIdentifier": ...,
    "DestinationUserIdentifier": ...,
    "DeveloperProviderName": ...,
    "IdentityPoolId": ...,
}

parent.merge_developer_identities(**kwargs)
  1. See MergeDeveloperIdentitiesInputRequestTypeDef

set_identity_pool_roles

Sets the roles for an identity pool.

Type annotations and code completion for boto3.client("cognito-identity").set_identity_pool_roles method. boto3 documentation

Method definition
def set_identity_pool_roles(
    self,
    *,
    IdentityPoolId: str,
    Roles: Mapping[str, str],
    RoleMappings: Mapping[str, RoleMappingTypeDef] = ...,  # (1)
) -> EmptyResponseMetadataTypeDef:  # (2)
    ...
  1. See RoleMappingTypeDef
  2. See EmptyResponseMetadataTypeDef
Usage example with kwargs
kwargs: SetIdentityPoolRolesInputRequestTypeDef = {  # (1)
    "IdentityPoolId": ...,
    "Roles": ...,
}

parent.set_identity_pool_roles(**kwargs)
  1. See SetIdentityPoolRolesInputRequestTypeDef

set_principal_tag_attribute_map

You can use this operation to use default (username and clientID) attribute or custom attribute mappings.

Type annotations and code completion for boto3.client("cognito-identity").set_principal_tag_attribute_map method. boto3 documentation

Method definition
def set_principal_tag_attribute_map(
    self,
    *,
    IdentityPoolId: str,
    IdentityProviderName: str,
    UseDefaults: bool = ...,
    PrincipalTags: Mapping[str, str] = ...,
) -> SetPrincipalTagAttributeMapResponseTypeDef:  # (1)
    ...
  1. See SetPrincipalTagAttributeMapResponseTypeDef
Usage example with kwargs
kwargs: SetPrincipalTagAttributeMapInputRequestTypeDef = {  # (1)
    "IdentityPoolId": ...,
    "IdentityProviderName": ...,
}

parent.set_principal_tag_attribute_map(**kwargs)
  1. See SetPrincipalTagAttributeMapInputRequestTypeDef

tag_resource

Assigns a set of tags to the specified Amazon Cognito identity pool.

Type annotations and code completion for boto3.client("cognito-identity").tag_resource method. boto3 documentation

Method definition
def tag_resource(
    self,
    *,
    ResourceArn: str,
    Tags: Mapping[str, str],
) -> Dict[str, Any]:
    ...
Usage example with kwargs
kwargs: TagResourceInputRequestTypeDef = {  # (1)
    "ResourceArn": ...,
    "Tags": ...,
}

parent.tag_resource(**kwargs)
  1. See TagResourceInputRequestTypeDef

Unlinks a DeveloperUserIdentifier from an existing identity.

Type annotations and code completion for boto3.client("cognito-identity").unlink_developer_identity method. boto3 documentation

Method definition
def unlink_developer_identity(
    self,
    *,
    IdentityId: str,
    IdentityPoolId: str,
    DeveloperProviderName: str,
    DeveloperUserIdentifier: str,
) -> EmptyResponseMetadataTypeDef:  # (1)
    ...
  1. See EmptyResponseMetadataTypeDef
Usage example with kwargs
kwargs: UnlinkDeveloperIdentityInputRequestTypeDef = {  # (1)
    "IdentityId": ...,
    "IdentityPoolId": ...,
    "DeveloperProviderName": ...,
    "DeveloperUserIdentifier": ...,
}

parent.unlink_developer_identity(**kwargs)
  1. See UnlinkDeveloperIdentityInputRequestTypeDef

Unlinks a federated identity from an existing account.

Type annotations and code completion for boto3.client("cognito-identity").unlink_identity method. boto3 documentation

Method definition
def unlink_identity(
    self,
    *,
    IdentityId: str,
    Logins: Mapping[str, str],
    LoginsToRemove: Sequence[str],
) -> EmptyResponseMetadataTypeDef:  # (1)
    ...
  1. See EmptyResponseMetadataTypeDef
Usage example with kwargs
kwargs: UnlinkIdentityInputRequestTypeDef = {  # (1)
    "IdentityId": ...,
    "Logins": ...,
    "LoginsToRemove": ...,
}

parent.unlink_identity(**kwargs)
  1. See UnlinkIdentityInputRequestTypeDef

untag_resource

Removes the specified tags from the specified Amazon Cognito identity pool.

Type annotations and code completion for boto3.client("cognito-identity").untag_resource method. boto3 documentation

Method definition
def untag_resource(
    self,
    *,
    ResourceArn: str,
    TagKeys: Sequence[str],
) -> Dict[str, Any]:
    ...
Usage example with kwargs
kwargs: UntagResourceInputRequestTypeDef = {  # (1)
    "ResourceArn": ...,
    "TagKeys": ...,
}

parent.untag_resource(**kwargs)
  1. See UntagResourceInputRequestTypeDef

update_identity_pool

Updates an identity pool.

Type annotations and code completion for boto3.client("cognito-identity").update_identity_pool method. boto3 documentation

Method definition
def update_identity_pool(
    self,
    *,
    IdentityPoolId: str,
    IdentityPoolName: str,
    AllowUnauthenticatedIdentities: bool,
    AllowClassicFlow: bool = ...,
    SupportedLoginProviders: Mapping[str, str] = ...,
    DeveloperProviderName: str = ...,
    OpenIdConnectProviderARNs: Sequence[str] = ...,
    CognitoIdentityProviders: Sequence[CognitoIdentityProviderTypeDef] = ...,  # (1)
    SamlProviderARNs: Sequence[str] = ...,
    IdentityPoolTags: Mapping[str, str] = ...,
) -> IdentityPoolTypeDef:  # (2)
    ...
  1. See CognitoIdentityProviderTypeDef
  2. See IdentityPoolTypeDef
Usage example with kwargs
kwargs: IdentityPoolRequestTypeDef = {  # (1)
    "IdentityPoolId": ...,
    "IdentityPoolName": ...,
    "AllowUnauthenticatedIdentities": ...,
}

parent.update_identity_pool(**kwargs)
  1. See IdentityPoolRequestTypeDef

get_paginator

Type annotations and code completion for boto3.client("cognito-identity").get_paginator method with overloads.