Amazon Cognito Identity

2015/01/20 - Amazon Cognito Identity - 4 new 2 updated api methods

GetIdentityPoolRoles (new) Link ¶

Gets the roles for an identity pool.

Request Syntax

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

string

param IdentityPoolId

An identity pool ID in the format REGION:GUID.

rtype

dict

returns

Response Syntax

{
    'IdentityPoolId': 'string',
    'Roles': {
        'string': 'string'
    }
}

Response Structure

  • (dict) --

    Returned in response to a successful GetIdentityPoolRoles operation.

    • IdentityPoolId (string) --

      An identity pool ID in the format REGION:GUID.

    • Roles (dict) --

      The map of roles associated with this pool. Currently only authenticated and unauthenticated roles are supported.

      • (string) --

        • (string) --

SetIdentityPoolRoles (new) Link ¶

Sets the roles for an identity pool. These roles are used when making calls to GetCredentialsForIdentity action.

Request Syntax

client.set_identity_pool_roles(
    IdentityPoolId='string',
    Roles={
        'string': 'string'
    }
)
type IdentityPoolId

string

param IdentityPoolId

[REQUIRED]

An identity pool ID in the format REGION:GUID.

type Roles

dict

param Roles

[REQUIRED]

The map of roles associated with this pool. Currently only authenticated and unauthenticated roles are supported.

  • (string) --

    • (string) --

returns

None

DescribeIdentity (new) Link ¶

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

Request Syntax

client.describe_identity(
    IdentityId='string'
)
type IdentityId

string

param IdentityId

[REQUIRED]

A unique identifier in the format REGION:GUID.

rtype

dict

returns

Response Syntax

{
    'IdentityId': 'string',
    'Logins': [
        'string',
    ],
    'CreationDate': datetime(2015, 1, 1),
    'LastModifiedDate': datetime(2015, 1, 1)
}

Response Structure

  • (dict) -- A description of the identity.

    • IdentityId (string) -- A unique identifier in the format REGION:GUID.

    • Logins (list) -- A set of optional name-value pairs that map provider names to provider tokens.

      • (string) --

    • CreationDate (datetime) --

      Date on which the identity was created.

    • LastModifiedDate (datetime) --

      Date on which the identity was last modified.

GetCredentialsForIdentity (new) Link ¶

Returns credentials for the 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 AWS Security Token Service with the appropriate role for the token.

Request Syntax

client.get_credentials_for_identity(
    IdentityId='string',
    Logins={
        'string': 'string'
    }
)
type IdentityId

string

param IdentityId

[REQUIRED]

A unique identifier in the format REGION:GUID.

type Logins

dict

param Logins

A set of optional name-value pairs that map provider names to provider tokens.

  • (string) --

    • (string) --

rtype

dict

returns

Response Syntax

{
    'IdentityId': 'string',
    'Credentials': {
        'AccessKeyId': 'string',
        'SecretKey': 'string',
        'SessionToken': 'string',
        'Expiration': datetime(2015, 1, 1)
    }
}

Response Structure

  • (dict) --

    Returned in response to a successful GetCredentialsForIdentity operation.

    • IdentityId (string) --

      A unique identifier in the format REGION:GUID.

    • Credentials (dict) --

      Credentials for the the provided identity ID.

      • AccessKeyId (string) --

        The Access Key portion of the credentials.

      • SecretKey (string) --

        The Secret Access Key portion of the credentials

      • SessionToken (string) --

        The Session Token portion of the credentials

      • Expiration (datetime) --

        The date at which these credentials will expire.

DescribeIdentity (updated) Link ¶
Changes (response)
{'CreationDate': 'timestamp', 'LastModifiedDate': 'timestamp'}

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

Request Syntax

client.describe_identity(
    IdentityId='string'
)
type IdentityId

string

param IdentityId

[REQUIRED]

A unique identifier in the format REGION:GUID.

rtype

dict

returns

Response Syntax

{
    'IdentityId': 'string',
    'Logins': [
        'string',
    ],
    'CreationDate': datetime(2015, 1, 1),
    'LastModifiedDate': datetime(2015, 1, 1)
}

Response Structure

  • (dict) -- A description of the identity.

    • IdentityId (string) -- A unique identifier in the format REGION:GUID.

    • Logins (list) -- A set of optional name-value pairs that map provider names to provider tokens.

      • (string) --

    • CreationDate (datetime) --

      Date on which the identity was created.

    • LastModifiedDate (datetime) --

      Date on which the identity was last modified.

ListIdentities (updated) Link ¶
Changes (response)
{'Identities': {'CreationDate': 'timestamp', 'LastModifiedDate': 'timestamp'}}

Lists the identities in a pool.

Request Syntax

client.list_identities(
    IdentityPoolId='string',
    MaxResults=123,
    NextToken='string'
)
type IdentityPoolId

string

param IdentityPoolId

[REQUIRED] An identity pool ID in the format REGION:GUID.

type MaxResults

integer

param MaxResults

[REQUIRED] The maximum number of identities to return.

type NextToken

string

param NextToken

A pagination token.

rtype

dict

returns

Response Syntax

{
    'IdentityPoolId': 'string',
    'Identities': [
        {
            'IdentityId': 'string',
            'Logins': [
                'string',
            ],
            'CreationDate': datetime(2015, 1, 1),
            'LastModifiedDate': datetime(2015, 1, 1)
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) -- The response to a ListIdentities request.

    • IdentityPoolId (string) -- An identity pool ID in the format REGION:GUID.

    • Identities (list) -- An object containing a set of identities and associated mappings.

      • (dict) -- A description of the identity.

        • IdentityId (string) -- A unique identifier in the format REGION:GUID.

        • Logins (list) -- A set of optional name-value pairs that map provider names to provider tokens.

          • (string) --

        • CreationDate (datetime) --

          Date on which the identity was created.

        • LastModifiedDate (datetime) --

          Date on which the identity was last modified.

    • NextToken (string) -- A pagination token.