Amazon Cognito Identity

2019/03/20 - Amazon Cognito Identity - 3 new 3 updated api methods

Changes  This release adds tags and tag-based access control support to Amazon Cognito Identity Pools (Federated Identities).

UntagResource (new) Link ¶

Removes the specified tags from an Amazon Cognito identity pool. You can use this action up to 5 times per second, per account

See also: AWS API Documentation

Request Syntax

client.untag_resource(
    ResourceArn='string',
    TagKeys=[
        'string',
    ]
)
type ResourceArn

string

param ResourceArn

[REQUIRED]

The Amazon Resource Name (ARN) of the identity pool that the tags are assigned to.

type TagKeys

list

param TagKeys

The keys of the tags to remove from the user pool.

  • (string) --

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) --

ListTagsForResource (new) Link ¶

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

A tag is a label that you can apply to identity pools to categorize and manage them in different ways, such as by purpose, owner, environment, or other criteria.

You can use this action up to 10 times per second, per account.

See also: AWS API Documentation

Request Syntax

client.list_tags_for_resource(
    ResourceArn='string'
)
type ResourceArn

string

param ResourceArn

[REQUIRED]

The Amazon Resource Name (ARN) of the identity pool that the tags are assigned to.

rtype

dict

returns

Response Syntax

{
    'Tags': {
        'string': 'string'
    }
}

Response Structure

  • (dict) --

    • Tags (dict) --

      The tags that are assigned to the identity pool.

      • (string) --

        • (string) --

TagResource (new) Link ¶

Assigns a set of tags to an Amazon Cognito identity pool. A tag is a label that you can use to categorize and manage identity pools in different ways, such as by purpose, owner, environment, or other criteria.

Each tag consists of a key and value, both of which you define. A key is a general category for more specific values. For example, if you have two versions of an identity pool, one for testing and another for production, you might assign an Environment tag key to both identity pools. The value of this key might be Test for one identity pool and Production for the other.

Tags are useful for cost tracking and access control. You can activate your tags so that they appear on the Billing and Cost Management console, where you can track the costs associated with your identity pools. In an IAM policy, you can constrain permissions for identity pools based on specific tags or tag values.

You can use this action up to 5 times per second, per account. An identity pool can have as many as 50 tags.

See also: AWS API Documentation

Request Syntax

client.tag_resource(
    ResourceArn='string',
    Tags={
        'string': 'string'
    }
)
type ResourceArn

string

param ResourceArn

[REQUIRED]

The Amazon Resource Name (ARN) of the identity pool to assign the tags to.

type Tags

dict

param Tags

The tags to assign to the identity pool.

  • (string) --

    • (string) --

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) --

CreateIdentityPool (updated) Link ¶
Changes (both)
{'IdentityPoolTags': {'string': 'string'}}

Creates a new identity pool. The identity pool is a store of user identity information that is specific to your AWS account. The limit on identity pools is 60 per account. The keys for SupportedLoginProviders are as follows:

  • Facebook: graph.facebook.com

  • Google: accounts.google.com

  • Amazon: www.amazon.com

  • Twitter: api.twitter.com

  • Digits: www.digits.com

You must use AWS Developer credentials to call this API.

See also: AWS API Documentation

Request Syntax

client.create_identity_pool(
    IdentityPoolName='string',
    AllowUnauthenticatedIdentities=True|False,
    SupportedLoginProviders={
        'string': 'string'
    },
    DeveloperProviderName='string',
    OpenIdConnectProviderARNs=[
        'string',
    ],
    CognitoIdentityProviders=[
        {
            'ProviderName': 'string',
            'ClientId': 'string',
            'ServerSideTokenCheck': True|False
        },
    ],
    SamlProviderARNs=[
        'string',
    ],
    IdentityPoolTags={
        'string': 'string'
    }
)
type IdentityPoolName

string

param IdentityPoolName

[REQUIRED]

A string that you provide.

type AllowUnauthenticatedIdentities

boolean

param AllowUnauthenticatedIdentities

[REQUIRED]

TRUE if the identity pool supports unauthenticated logins.

type SupportedLoginProviders

dict

param SupportedLoginProviders

Optional key:value pairs mapping provider names to provider app IDs.

  • (string) --

    • (string) --

type DeveloperProviderName

string

param DeveloperProviderName

The "domain" by which Cognito will refer to your users. This name acts as a placeholder that allows your backend and the Cognito service to communicate about the developer provider. For the DeveloperProviderName , you can use letters as well as period (. ), underscore (_ ), and dash (- ).

Once you have set a developer provider name, you cannot change it. Please take care in setting this parameter.

type OpenIdConnectProviderARNs

list

param OpenIdConnectProviderARNs

A list of OpendID Connect provider ARNs.

  • (string) --

type CognitoIdentityProviders

list

param CognitoIdentityProviders

An array of Amazon Cognito user pools and their client IDs.

  • (dict) --

    A provider representing an Amazon Cognito user pool and its client ID.

    • ProviderName (string) --

      The provider name for an Amazon Cognito user pool. For example, cognito-idp.us-east-1.amazonaws.com/us-east-1_123456789 .

    • ClientId (string) --

      The client ID for the Amazon Cognito user pool.

    • ServerSideTokenCheck (boolean) --

      TRUE if server-side token validation is enabled for the identity provider’s token.

      Once you set ServerSideTokenCheck to TRUE for an identity pool, that identity pool will check with the integrated user pools to make sure that the user has not been globally signed out or deleted before the identity pool provides an OIDC token or AWS credentials for the user.

      If the user is signed out or deleted, the identity pool will return a 400 Not Authorized error.

type SamlProviderARNs

list

param SamlProviderARNs

An array of Amazon Resource Names (ARNs) of the SAML provider for your identity pool.

  • (string) --

type IdentityPoolTags

dict

param IdentityPoolTags

Tags to assign to the identity pool. A tag is a label that you can apply to identity pools to categorize and manage them in different ways, such as by purpose, owner, environment, or other criteria.

  • (string) --

    • (string) --

rtype

dict

returns

Response Syntax

{
    'IdentityPoolId': 'string',
    'IdentityPoolName': 'string',
    'AllowUnauthenticatedIdentities': True|False,
    'SupportedLoginProviders': {
        'string': 'string'
    },
    'DeveloperProviderName': 'string',
    'OpenIdConnectProviderARNs': [
        'string',
    ],
    'CognitoIdentityProviders': [
        {
            'ProviderName': 'string',
            'ClientId': 'string',
            'ServerSideTokenCheck': True|False
        },
    ],
    'SamlProviderARNs': [
        'string',
    ],
    'IdentityPoolTags': {
        'string': 'string'
    }
}

Response Structure

  • (dict) --

    An object representing an Amazon Cognito identity pool.

    • IdentityPoolId (string) --

      An identity pool ID in the format REGION:GUID.

    • IdentityPoolName (string) --

      A string that you provide.

    • AllowUnauthenticatedIdentities (boolean) --

      TRUE if the identity pool supports unauthenticated logins.

    • SupportedLoginProviders (dict) --

      Optional key:value pairs mapping provider names to provider app IDs.

      • (string) --

        • (string) --

    • DeveloperProviderName (string) --

      The "domain" by which Cognito will refer to your users.

    • OpenIdConnectProviderARNs (list) --

      A list of OpendID Connect provider ARNs.

      • (string) --

    • CognitoIdentityProviders (list) --

      A list representing an Amazon Cognito user pool and its client ID.

      • (dict) --

        A provider representing an Amazon Cognito user pool and its client ID.

        • ProviderName (string) --

          The provider name for an Amazon Cognito user pool. For example, cognito-idp.us-east-1.amazonaws.com/us-east-1_123456789 .

        • ClientId (string) --

          The client ID for the Amazon Cognito user pool.

        • ServerSideTokenCheck (boolean) --

          TRUE if server-side token validation is enabled for the identity provider’s token.

          Once you set ServerSideTokenCheck to TRUE for an identity pool, that identity pool will check with the integrated user pools to make sure that the user has not been globally signed out or deleted before the identity pool provides an OIDC token or AWS credentials for the user.

          If the user is signed out or deleted, the identity pool will return a 400 Not Authorized error.

    • SamlProviderARNs (list) --

      An array of Amazon Resource Names (ARNs) of the SAML provider for your identity pool.

      • (string) --

    • IdentityPoolTags (dict) --

      The tags that are assigned to the identity pool. A tag is a label that you can apply to identity pools to categorize and manage them in different ways, such as by purpose, owner, environment, or other criteria.

      • (string) --

        • (string) --

DescribeIdentityPool (updated) Link ¶
Changes (response)
{'IdentityPoolTags': {'string': 'string'}}

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

You must use AWS Developer credentials to call this API.

See also: AWS API Documentation

Request Syntax

client.describe_identity_pool(
    IdentityPoolId='string'
)
type IdentityPoolId

string

param IdentityPoolId

[REQUIRED]

An identity pool ID in the format REGION:GUID.

rtype

dict

returns

Response Syntax

{
    'IdentityPoolId': 'string',
    'IdentityPoolName': 'string',
    'AllowUnauthenticatedIdentities': True|False,
    'SupportedLoginProviders': {
        'string': 'string'
    },
    'DeveloperProviderName': 'string',
    'OpenIdConnectProviderARNs': [
        'string',
    ],
    'CognitoIdentityProviders': [
        {
            'ProviderName': 'string',
            'ClientId': 'string',
            'ServerSideTokenCheck': True|False
        },
    ],
    'SamlProviderARNs': [
        'string',
    ],
    'IdentityPoolTags': {
        'string': 'string'
    }
}

Response Structure

  • (dict) --

    An object representing an Amazon Cognito identity pool.

    • IdentityPoolId (string) --

      An identity pool ID in the format REGION:GUID.

    • IdentityPoolName (string) --

      A string that you provide.

    • AllowUnauthenticatedIdentities (boolean) --

      TRUE if the identity pool supports unauthenticated logins.

    • SupportedLoginProviders (dict) --

      Optional key:value pairs mapping provider names to provider app IDs.

      • (string) --

        • (string) --

    • DeveloperProviderName (string) --

      The "domain" by which Cognito will refer to your users.

    • OpenIdConnectProviderARNs (list) --

      A list of OpendID Connect provider ARNs.

      • (string) --

    • CognitoIdentityProviders (list) --

      A list representing an Amazon Cognito user pool and its client ID.

      • (dict) --

        A provider representing an Amazon Cognito user pool and its client ID.

        • ProviderName (string) --

          The provider name for an Amazon Cognito user pool. For example, cognito-idp.us-east-1.amazonaws.com/us-east-1_123456789 .

        • ClientId (string) --

          The client ID for the Amazon Cognito user pool.

        • ServerSideTokenCheck (boolean) --

          TRUE if server-side token validation is enabled for the identity provider’s token.

          Once you set ServerSideTokenCheck to TRUE for an identity pool, that identity pool will check with the integrated user pools to make sure that the user has not been globally signed out or deleted before the identity pool provides an OIDC token or AWS credentials for the user.

          If the user is signed out or deleted, the identity pool will return a 400 Not Authorized error.

    • SamlProviderARNs (list) --

      An array of Amazon Resource Names (ARNs) of the SAML provider for your identity pool.

      • (string) --

    • IdentityPoolTags (dict) --

      The tags that are assigned to the identity pool. A tag is a label that you can apply to identity pools to categorize and manage them in different ways, such as by purpose, owner, environment, or other criteria.

      • (string) --

        • (string) --

UpdateIdentityPool (updated) Link ¶
Changes (both)
{'IdentityPoolTags': {'string': 'string'}}

Updates an identity pool.

You must use AWS Developer credentials to call this API.

See also: AWS API Documentation

Request Syntax

client.update_identity_pool(
    IdentityPoolId='string',
    IdentityPoolName='string',
    AllowUnauthenticatedIdentities=True|False,
    SupportedLoginProviders={
        'string': 'string'
    },
    DeveloperProviderName='string',
    OpenIdConnectProviderARNs=[
        'string',
    ],
    CognitoIdentityProviders=[
        {
            'ProviderName': 'string',
            'ClientId': 'string',
            'ServerSideTokenCheck': True|False
        },
    ],
    SamlProviderARNs=[
        'string',
    ],
    IdentityPoolTags={
        'string': 'string'
    }
)
type IdentityPoolId

string

param IdentityPoolId

[REQUIRED]

An identity pool ID in the format REGION:GUID.

type IdentityPoolName

string

param IdentityPoolName

[REQUIRED]

A string that you provide.

type AllowUnauthenticatedIdentities

boolean

param AllowUnauthenticatedIdentities

[REQUIRED]

TRUE if the identity pool supports unauthenticated logins.

type SupportedLoginProviders

dict

param SupportedLoginProviders

Optional key:value pairs mapping provider names to provider app IDs.

  • (string) --

    • (string) --

type DeveloperProviderName

string

param DeveloperProviderName

The "domain" by which Cognito will refer to your users.

type OpenIdConnectProviderARNs

list

param OpenIdConnectProviderARNs

A list of OpendID Connect provider ARNs.

  • (string) --

type CognitoIdentityProviders

list

param CognitoIdentityProviders

A list representing an Amazon Cognito user pool and its client ID.

  • (dict) --

    A provider representing an Amazon Cognito user pool and its client ID.

    • ProviderName (string) --

      The provider name for an Amazon Cognito user pool. For example, cognito-idp.us-east-1.amazonaws.com/us-east-1_123456789 .

    • ClientId (string) --

      The client ID for the Amazon Cognito user pool.

    • ServerSideTokenCheck (boolean) --

      TRUE if server-side token validation is enabled for the identity provider’s token.

      Once you set ServerSideTokenCheck to TRUE for an identity pool, that identity pool will check with the integrated user pools to make sure that the user has not been globally signed out or deleted before the identity pool provides an OIDC token or AWS credentials for the user.

      If the user is signed out or deleted, the identity pool will return a 400 Not Authorized error.

type SamlProviderARNs

list

param SamlProviderARNs

An array of Amazon Resource Names (ARNs) of the SAML provider for your identity pool.

  • (string) --

type IdentityPoolTags

dict

param IdentityPoolTags

The tags that are assigned to the identity pool. A tag is a label that you can apply to identity pools to categorize and manage them in different ways, such as by purpose, owner, environment, or other criteria.

  • (string) --

    • (string) --

rtype

dict

returns

Response Syntax

{
    'IdentityPoolId': 'string',
    'IdentityPoolName': 'string',
    'AllowUnauthenticatedIdentities': True|False,
    'SupportedLoginProviders': {
        'string': 'string'
    },
    'DeveloperProviderName': 'string',
    'OpenIdConnectProviderARNs': [
        'string',
    ],
    'CognitoIdentityProviders': [
        {
            'ProviderName': 'string',
            'ClientId': 'string',
            'ServerSideTokenCheck': True|False
        },
    ],
    'SamlProviderARNs': [
        'string',
    ],
    'IdentityPoolTags': {
        'string': 'string'
    }
}

Response Structure

  • (dict) --

    An object representing an Amazon Cognito identity pool.

    • IdentityPoolId (string) --

      An identity pool ID in the format REGION:GUID.

    • IdentityPoolName (string) --

      A string that you provide.

    • AllowUnauthenticatedIdentities (boolean) --

      TRUE if the identity pool supports unauthenticated logins.

    • SupportedLoginProviders (dict) --

      Optional key:value pairs mapping provider names to provider app IDs.

      • (string) --

        • (string) --

    • DeveloperProviderName (string) --

      The "domain" by which Cognito will refer to your users.

    • OpenIdConnectProviderARNs (list) --

      A list of OpendID Connect provider ARNs.

      • (string) --

    • CognitoIdentityProviders (list) --

      A list representing an Amazon Cognito user pool and its client ID.

      • (dict) --

        A provider representing an Amazon Cognito user pool and its client ID.

        • ProviderName (string) --

          The provider name for an Amazon Cognito user pool. For example, cognito-idp.us-east-1.amazonaws.com/us-east-1_123456789 .

        • ClientId (string) --

          The client ID for the Amazon Cognito user pool.

        • ServerSideTokenCheck (boolean) --

          TRUE if server-side token validation is enabled for the identity provider’s token.

          Once you set ServerSideTokenCheck to TRUE for an identity pool, that identity pool will check with the integrated user pools to make sure that the user has not been globally signed out or deleted before the identity pool provides an OIDC token or AWS credentials for the user.

          If the user is signed out or deleted, the identity pool will return a 400 Not Authorized error.

    • SamlProviderARNs (list) --

      An array of Amazon Resource Names (ARNs) of the SAML provider for your identity pool.

      • (string) --

    • IdentityPoolTags (dict) --

      The tags that are assigned to the identity pool. A tag is a label that you can apply to identity pools to categorize and manage them in different ways, such as by purpose, owner, environment, or other criteria.

      • (string) --

        • (string) --