You are viewing documentation for version 3 of the AWS SDK for Ruby. Version 2 documentation can be found here.

Class: Aws::CognitoIdentity::Client

Inherits:
Seahorse::Client::Base show all
Includes:
Aws::ClientStubs
Defined in:
gems/aws-sdk-cognitoidentity/lib/aws-sdk-cognitoidentity/client.rb

Instance Attribute Summary

Attributes inherited from Seahorse::Client::Base

#config, #handlers

API Operations collapse

Instance Method Summary collapse

Methods included from Aws::ClientStubs

#stub_data, #stub_responses

Methods inherited from Seahorse::Client::Base

add_plugin, api, clear_plugins, define, new, #operation_names, plugins, remove_plugin, set_api, set_plugins

Methods included from Seahorse::Client::HandlerBuilder

#handle, #handle_request, #handle_response

Constructor Details

#initialize(*args) ⇒ Client

Returns a new instance of Client

Parameters:

  • options (Hash)

    a customizable set of options



152
153
154
# File 'gems/aws-sdk-cognitoidentity/lib/aws-sdk-cognitoidentity/client.rb', line 152

def initialize(*args)
  super
end

Instance Method Details

#create_identity_pool(params = {}) ⇒ Types::IdentityPool

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.

Examples:

Request syntax with placeholder values


resp = client.create_identity_pool({
  identity_pool_name: "IdentityPoolName", # required
  allow_unauthenticated_identities: false, # required
  supported_login_providers: {
    "IdentityProviderName" => "IdentityProviderId",
  },
  developer_provider_name: "DeveloperProviderName",
  open_id_connect_provider_arns: ["ARNString"],
  cognito_identity_providers: [
    {
      provider_name: "CognitoIdentityProviderName",
      client_id: "CognitoIdentityProviderClientId",
      server_side_token_check: false,
    },
  ],
  saml_provider_arns: ["ARNString"],
})

Response structure


resp.identity_pool_id #=> String
resp.identity_pool_name #=> String
resp.allow_unauthenticated_identities #=> Boolean
resp. #=> Hash
resp.["IdentityProviderName"] #=> String
resp.developer_provider_name #=> String
resp.open_id_connect_provider_arns #=> Array
resp.open_id_connect_provider_arns[0] #=> String
resp.cognito_identity_providers #=> Array
resp.cognito_identity_providers[0].provider_name #=> String
resp.cognito_identity_providers[0].client_id #=> String
resp.cognito_identity_providers[0].server_side_token_check #=> Boolean
resp.saml_provider_arns #=> Array
resp.saml_provider_arns[0] #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :identity_pool_name (required, String)

    A string that you provide.

  • :allow_unauthenticated_identities (required, Boolean)

    TRUE if the identity pool supports unauthenticated logins.

  • :supported_login_providers (Hash<String,String>)

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

  • :developer_provider_name (String)

    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.

  • :open_id_connect_provider_arns (Array<String>)

    A list of OpendID Connect provider ARNs.

  • :cognito_identity_providers (Array<Types::CognitoIdentityProvider>)

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

  • :saml_provider_arns (Array<String>)

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

Returns:

See Also:



256
257
258
259
# File 'gems/aws-sdk-cognitoidentity/lib/aws-sdk-cognitoidentity/client.rb', line 256

def create_identity_pool(params = {}, options = {})
  req = build_request(:create_identity_pool, params)
  req.send_request(options)
end

#delete_identities(params = {}) ⇒ Types::DeleteIdentitiesResponse

Deletes identities from an identity pool. You can specify a list of 1-60 identities that you want to delete.

You must use AWS Developer credentials to call this API.

Examples:

Request syntax with placeholder values


resp = client.delete_identities({
  identity_ids_to_delete: ["IdentityId"], # required
})

Response structure


resp.unprocessed_identity_ids #=> Array
resp.unprocessed_identity_ids[0].identity_id #=> String
resp.unprocessed_identity_ids[0].error_code #=> String, one of "AccessDenied", "InternalServerError"

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :identity_ids_to_delete (required, Array<String>)

    A list of 1-60 identities that you want to delete.

Returns:

See Also:



289
290
291
292
# File 'gems/aws-sdk-cognitoidentity/lib/aws-sdk-cognitoidentity/client.rb', line 289

def delete_identities(params = {}, options = {})
  req = build_request(:delete_identities, params)
  req.send_request(options)
end

#delete_identity_pool(params = {}) ⇒ Struct

Deletes a user pool. Once a pool is deleted, users will not be able to authenticate with the pool.

You must use AWS Developer credentials to call this API.

Examples:

Request syntax with placeholder values


resp = client.delete_identity_pool({
  identity_pool_id: "IdentityPoolId", # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :identity_pool_id (required, String)

    An identity pool ID in the format REGION:GUID.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



314
315
316
317
# File 'gems/aws-sdk-cognitoidentity/lib/aws-sdk-cognitoidentity/client.rb', line 314

def delete_identity_pool(params = {}, options = {})
  req = build_request(:delete_identity_pool, params)
  req.send_request(options)
end

#describe_identity(params = {}) ⇒ Types::IdentityDescription

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

You must use AWS Developer credentials to call this API.

Examples:

Request syntax with placeholder values


resp = client.describe_identity({
  identity_id: "IdentityId", # required
})

Response structure


resp.identity_id #=> String
resp.logins #=> Array
resp.logins[0] #=> String
resp.creation_date #=> Time
resp.last_modified_date #=> Time

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :identity_id (required, String)

    A unique identifier in the format REGION:GUID.

Returns:

See Also:



352
353
354
355
# File 'gems/aws-sdk-cognitoidentity/lib/aws-sdk-cognitoidentity/client.rb', line 352

def describe_identity(params = {}, options = {})
  req = build_request(:describe_identity, params)
  req.send_request(options)
end

#describe_identity_pool(params = {}) ⇒ Types::IdentityPool

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.

Examples:

Request syntax with placeholder values


resp = client.describe_identity_pool({
  identity_pool_id: "IdentityPoolId", # required
})

Response structure


resp.identity_pool_id #=> String
resp.identity_pool_name #=> String
resp.allow_unauthenticated_identities #=> Boolean
resp. #=> Hash
resp.["IdentityProviderName"] #=> String
resp.developer_provider_name #=> String
resp.open_id_connect_provider_arns #=> Array
resp.open_id_connect_provider_arns[0] #=> String
resp.cognito_identity_providers #=> Array
resp.cognito_identity_providers[0].provider_name #=> String
resp.cognito_identity_providers[0].client_id #=> String
resp.cognito_identity_providers[0].server_side_token_check #=> Boolean
resp.saml_provider_arns #=> Array
resp.saml_provider_arns[0] #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :identity_pool_id (required, String)

    An identity pool ID in the format REGION:GUID.

Returns:

See Also:



403
404
405
406
# File 'gems/aws-sdk-cognitoidentity/lib/aws-sdk-cognitoidentity/client.rb', line 403

def describe_identity_pool(params = {}, options = {})
  req = build_request(:describe_identity_pool, params)
  req.send_request(options)
end

#get_credentials_for_identity(params = {}) ⇒ Types::GetCredentialsForIdentityResponse

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 AWS 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.

Examples:

Request syntax with placeholder values


resp = client.get_credentials_for_identity({
  identity_id: "IdentityId", # required
  logins: {
    "IdentityProviderName" => "IdentityProviderToken",
  },
  custom_role_arn: "ARNString",
})

Response structure


resp.identity_id #=> String
resp.credentials.access_key_id #=> String
resp.credentials.secret_key #=> String
resp.credentials.session_token #=> String
resp.credentials.expiration #=> Time

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :identity_id (required, String)

    A unique identifier in the format REGION:GUID.

  • :logins (Hash<String,String>)

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

  • :custom_role_arn (String)

    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.

Returns:

See Also:



456
457
458
459
# File 'gems/aws-sdk-cognitoidentity/lib/aws-sdk-cognitoidentity/client.rb', line 456

def get_credentials_for_identity(params = {}, options = {})
  req = build_request(:get_credentials_for_identity, params)
  req.send_request(options)
end

#get_id(params = {}) ⇒ Types::GetIdResponse

Generates (or retrieves) a Cognito ID. Supplying multiple logins will create an implicit linked account.

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

Examples:

Request syntax with placeholder values


resp = client.get_id({
  account_id: "AccountId",
  identity_pool_id: "IdentityPoolId", # required
  logins: {
    "IdentityProviderName" => "IdentityProviderToken",
  },
})

Response structure


resp.identity_id #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :account_id (String)

    A standard AWS account ID (9+ digits).

  • :identity_pool_id (required, String)

    An identity pool ID in the format REGION:GUID.

  • :logins (Hash<String,String>)

    A set of optional name-value pairs that map provider names to provider tokens. The available provider names for Logins are as follows:

    • Facebook: graph.facebook.com

    • Amazon Cognito Identity Provider: cognito-idp.us-east-1.amazonaws.com/us-east-1_123456789

    • Google: accounts.google.com

    • Amazon: www.amazon.com

    • Twitter: api.twitter.com

    • Digits: www.digits.com

Returns:

See Also:



512
513
514
515
# File 'gems/aws-sdk-cognitoidentity/lib/aws-sdk-cognitoidentity/client.rb', line 512

def get_id(params = {}, options = {})
  req = build_request(:get_id, params)
  req.send_request(options)
end

#get_identity_pool_roles(params = {}) ⇒ Types::GetIdentityPoolRolesResponse

Gets the roles for an identity pool.

You must use AWS Developer credentials to call this API.

Examples:

Request syntax with placeholder values


resp = client.get_identity_pool_roles({
  identity_pool_id: "IdentityPoolId", # required
})

Response structure


resp.identity_pool_id #=> String
resp.roles #=> Hash
resp.roles["RoleType"] #=> String
resp.role_mappings #=> Hash
resp.role_mappings["IdentityProviderName"].type #=> String, one of "Token", "Rules"
resp.role_mappings["IdentityProviderName"].ambiguous_role_resolution #=> String, one of "AuthenticatedRole", "Deny"
resp.role_mappings["IdentityProviderName"].rules_configuration.rules #=> Array
resp.role_mappings["IdentityProviderName"].rules_configuration.rules[0].claim #=> String
resp.role_mappings["IdentityProviderName"].rules_configuration.rules[0].match_type #=> String, one of "Equals", "Contains", "StartsWith", "NotEqual"
resp.role_mappings["IdentityProviderName"].rules_configuration.rules[0].value #=> String
resp.role_mappings["IdentityProviderName"].rules_configuration.rules[0].role_arn #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :identity_pool_id (required, String)

    An identity pool ID in the format REGION:GUID.

Returns:

See Also:



554
555
556
557
# File 'gems/aws-sdk-cognitoidentity/lib/aws-sdk-cognitoidentity/client.rb', line 554

def get_identity_pool_roles(params = {}, options = {})
  req = build_request(:get_identity_pool_roles, params)
  req.send_request(options)
end

#get_open_id_token(params = {}) ⇒ Types::GetOpenIdTokenResponse

Gets an OpenID token, using a known Cognito ID. This known Cognito ID is returned by GetId. You can optionally add additional logins for the identity. Supplying multiple logins creates an implicit link.

The OpenId token is valid for 15 minutes.

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

Examples:

Request syntax with placeholder values


resp = client.get_open_id_token({
  identity_id: "IdentityId", # required
  logins: {
    "IdentityProviderName" => "IdentityProviderToken",
  },
})

Response structure


resp.identity_id #=> String
resp.token #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :identity_id (required, String)

    A unique identifier in the format REGION:GUID.

  • :logins (Hash<String,String>)

    A set of optional name-value pairs that map provider names to provider tokens. When using graph.facebook.com and www.amazon.com, supply the access_token returned from the provider's authflow. For accounts.google.com, an Amazon Cognito Identity Provider, or any other OpenId Connect provider, always include the id_token.

Returns:

See Also:



601
602
603
604
# File 'gems/aws-sdk-cognitoidentity/lib/aws-sdk-cognitoidentity/client.rb', line 601

def get_open_id_token(params = {}, options = {})
  req = build_request(:get_open_id_token, params)
  req.send_request(options)
end

#get_open_id_token_for_developer_identity(params = {}) ⇒ Types::GetOpenIdTokenForDeveloperIdentityResponse

Registers (or retrieves) a Cognito IdentityId and an OpenID Connect token for a user authenticated by your backend authentication process. Supplying multiple logins will create an implicit linked account. You can only specify one developer provider as part of the Logins map, which is linked to the identity pool. The developer provider is the "domain" by which Cognito will refer to your users.

You can use GetOpenIdTokenForDeveloperIdentity to create a new identity and to link new logins (that is, user credentials issued by a public provider or developer provider) to an existing identity. When you want to create a new identity, the IdentityId should be null. When you want to associate a new login with an existing authenticated/unauthenticated identity, you can do so by providing the existing IdentityId. This API will create the identity in the specified IdentityPoolId.

You must use AWS Developer credentials to call this API.

Examples:

Request syntax with placeholder values


resp = client.get_open_id_token_for_developer_identity({
  identity_pool_id: "IdentityPoolId", # required
  identity_id: "IdentityId",
  logins: { # required
    "IdentityProviderName" => "IdentityProviderToken",
  },
  token_duration: 1,
})

Response structure


resp.identity_id #=> String
resp.token #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :identity_pool_id (required, String)

    An identity pool ID in the format REGION:GUID.

  • :identity_id (String)

    A unique identifier in the format REGION:GUID.

  • :logins (required, Hash<String,String>)

    A set of optional name-value pairs that map provider names to provider tokens. Each name-value pair represents a user from a public provider or developer provider. If the user is from a developer provider, the name-value pair will follow the syntax "developer_provider_name": "developer_user_identifier". The developer provider is the "domain" by which Cognito will refer to your users; you provided this domain while creating/updating the identity pool. The developer user identifier is an identifier from your backend that uniquely identifies a user. When you create an identity pool, you can specify the supported logins.

  • :token_duration (Integer)

    The expiration time of the token, in seconds. You can specify a custom expiration time for the token so that you can cache it. If you don't provide an expiration time, the token is valid for 15 minutes. You can exchange the token with Amazon STS for temporary AWS credentials, which are valid for a maximum of one hour. The maximum token duration you can set is 24 hours. You should take care in setting the expiration time for a token, as there are significant security implications: an attacker could use a leaked token to access your AWS resources for the token's duration.

Returns:

See Also:



678
679
680
681
# File 'gems/aws-sdk-cognitoidentity/lib/aws-sdk-cognitoidentity/client.rb', line 678

def get_open_id_token_for_developer_identity(params = {}, options = {})
  req = build_request(:get_open_id_token_for_developer_identity, params)
  req.send_request(options)
end

#list_identities(params = {}) ⇒ Types::ListIdentitiesResponse

Lists the identities in a pool.

You must use AWS Developer credentials to call this API.

Examples:

Request syntax with placeholder values


resp = client.list_identities({
  identity_pool_id: "IdentityPoolId", # required
  max_results: 1, # required
  next_token: "PaginationKey",
  hide_disabled: false,
})

Response structure


resp.identity_pool_id #=> String
resp.identities #=> Array
resp.identities[0].identity_id #=> String
resp.identities[0].logins #=> Array
resp.identities[0].logins[0] #=> String
resp.identities[0].creation_date #=> Time
resp.identities[0].last_modified_date #=> Time
resp.next_token #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :identity_pool_id (required, String)

    An identity pool ID in the format REGION:GUID.

  • :max_results (required, Integer)

    The maximum number of identities to return.

  • :next_token (String)

    A pagination token.

  • :hide_disabled (Boolean)

    An optional boolean parameter that allows you to hide disabled identities. If omitted, the ListIdentities API will include disabled identities in the response.

Returns:

See Also:



731
732
733
734
# File 'gems/aws-sdk-cognitoidentity/lib/aws-sdk-cognitoidentity/client.rb', line 731

def list_identities(params = {}, options = {})
  req = build_request(:list_identities, params)
  req.send_request(options)
end

#list_identity_pools(params = {}) ⇒ Types::ListIdentityPoolsResponse

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

You must use AWS Developer credentials to call this API.

Examples:

Request syntax with placeholder values


resp = client.list_identity_pools({
  max_results: 1, # required
  next_token: "PaginationKey",
})

Response structure


resp.identity_pools #=> Array
resp.identity_pools[0].identity_pool_id #=> String
resp.identity_pools[0].identity_pool_name #=> String
resp.next_token #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :max_results (required, Integer)

    The maximum number of identities to return.

  • :next_token (String)

    A pagination token.

Returns:

See Also:



769
770
771
772
# File 'gems/aws-sdk-cognitoidentity/lib/aws-sdk-cognitoidentity/client.rb', line 769

def list_identity_pools(params = {}, options = {})
  req = build_request(:list_identity_pools, params)
  req.send_request(options)
end

#lookup_developer_identity(params = {}) ⇒ Types::LookupDeveloperIdentityResponse

Retrieves the IdentityID associated with a DeveloperUserIdentifier or the list of DeveloperUserIdentifiers associated with an IdentityId for an existing identity. Either IdentityID or DeveloperUserIdentifier must not be null. If you supply only one of these values, the other value will be searched in the database and returned as a part of the response. If you supply both, DeveloperUserIdentifier will be matched against IdentityID. If the values are verified against the database, the response returns both values and is the same as the request. Otherwise a ResourceConflictException is thrown.

You must use AWS Developer credentials to call this API.

Examples:

Request syntax with placeholder values


resp = client.lookup_developer_identity({
  identity_pool_id: "IdentityPoolId", # required
  identity_id: "IdentityId",
  developer_user_identifier: "DeveloperUserIdentifier",
  max_results: 1,
  next_token: "PaginationKey",
})

Response structure


resp.identity_id #=> String
resp.developer_user_identifier_list #=> Array
resp.developer_user_identifier_list[0] #=> String
resp.next_token #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :identity_pool_id (required, String)

    An identity pool ID in the format REGION:GUID.

  • :identity_id (String)

    A unique identifier in the format REGION:GUID.

  • :developer_user_identifier (String)

    A unique ID used by your backend authentication process to identify a user. Typically, a developer identity provider would issue many developer user identifiers, in keeping with the number of users.

  • :max_results (Integer)

    The maximum number of identities to return.

  • :next_token (String)

    A pagination token. The first call you make will have NextToken set to null. After that the service will return NextToken values as needed. For example, let's say you make a request with MaxResults set to 10, and there are 20 matches in the database. The service will return a pagination token as a part of the response. This token can be used to call the API again and get results starting from the 11th match.

Returns:

See Also:



837
838
839
840
# File 'gems/aws-sdk-cognitoidentity/lib/aws-sdk-cognitoidentity/client.rb', line 837

def lookup_developer_identity(params = {}, options = {})
  req = build_request(:lookup_developer_identity, params)
  req.send_request(options)
end

#merge_developer_identities(params = {}) ⇒ Types::MergeDeveloperIdentitiesResponse

Merges two users having different IdentityIds, existing in the same identity pool, and identified by the same developer provider. You can use this action to request that discrete users be merged and identified as a single user in the Cognito environment. Cognito associates the given source user (SourceUserIdentifier) with the IdentityId of the DestinationUserIdentifier. Only developer-authenticated users can be merged. If the users to be merged are associated with the same public provider, but as two different users, an exception will be thrown.

You must use AWS Developer credentials to call this API.

Examples:

Request syntax with placeholder values


resp = client.merge_developer_identities({
  source_user_identifier: "DeveloperUserIdentifier", # required
  destination_user_identifier: "DeveloperUserIdentifier", # required
  developer_provider_name: "DeveloperProviderName", # required
  identity_pool_id: "IdentityPoolId", # required
})

Response structure


resp.identity_id #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :source_user_identifier (required, String)

    User identifier for the source user. The value should be a DeveloperUserIdentifier.

  • :destination_user_identifier (required, String)

    User identifier for the destination user. The value should be a DeveloperUserIdentifier.

  • :developer_provider_name (required, String)

    The "domain" by which Cognito will refer to your users. This is a (pseudo) domain name that you provide while creating an identity pool. 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 (-).

  • :identity_pool_id (required, String)

    An identity pool ID in the format REGION:GUID.

Returns:

See Also:



894
895
896
897
# File 'gems/aws-sdk-cognitoidentity/lib/aws-sdk-cognitoidentity/client.rb', line 894

def merge_developer_identities(params = {}, options = {})
  req = build_request(:merge_developer_identities, params)
  req.send_request(options)
end

#set_identity_pool_roles(params = {}) ⇒ Struct

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

You must use AWS Developer credentials to call this API.

Examples:

Request syntax with placeholder values


resp = client.set_identity_pool_roles({
  identity_pool_id: "IdentityPoolId", # required
  roles: { # required
    "RoleType" => "ARNString",
  },
  role_mappings: {
    "IdentityProviderName" => {
      type: "Token", # required, accepts Token, Rules
      ambiguous_role_resolution: "AuthenticatedRole", # accepts AuthenticatedRole, Deny
      rules_configuration: {
        rules: [ # required
          {
            claim: "ClaimName", # required
            match_type: "Equals", # required, accepts Equals, Contains, StartsWith, NotEqual
            value: "ClaimValue", # required
            role_arn: "ARNString", # required
          },
        ],
      },
    },
  },
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :identity_pool_id (required, String)

    An identity pool ID in the format REGION:GUID.

  • :roles (required, Hash<String,String>)

    The map of roles associated with this pool. For a given role, the key will be either "authenticated" or "unauthenticated" and the value will be the Role ARN.

  • :role_mappings (Hash<String,Types::RoleMapping>)

    How users for a specific identity provider are to mapped to roles. This is a string to RoleMapping object map. The string identifies the identity provider, for example, "graph.facebook.com" or "cognito-idp-east-1.amazonaws.com/us-east-1_abcdefghi:app_client_id".

    Up to 25 rules can be specified per identity provider.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



951
952
953
954
# File 'gems/aws-sdk-cognitoidentity/lib/aws-sdk-cognitoidentity/client.rb', line 951

def set_identity_pool_roles(params = {}, options = {})
  req = build_request(:set_identity_pool_roles, params)
  req.send_request(options)
end

Unlinks a DeveloperUserIdentifier from an existing identity. Unlinked developer users will be considered new identities next time they are seen. If, for a given Cognito identity, you remove all federated identities as well as the developer user identifier, the Cognito identity becomes inaccessible.

You must use AWS Developer credentials to call this API.

Examples:

Request syntax with placeholder values


resp = client.unlink_developer_identity({
  identity_id: "IdentityId", # required
  identity_pool_id: "IdentityPoolId", # required
  developer_provider_name: "DeveloperProviderName", # required
  developer_user_identifier: "DeveloperUserIdentifier", # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :identity_id (required, String)

    A unique identifier in the format REGION:GUID.

  • :identity_pool_id (required, String)

    An identity pool ID in the format REGION:GUID.

  • :developer_provider_name (required, String)

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

  • :developer_user_identifier (required, String)

    A unique ID used by your backend authentication process to identify a user.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



992
993
994
995
# File 'gems/aws-sdk-cognitoidentity/lib/aws-sdk-cognitoidentity/client.rb', line 992

def unlink_developer_identity(params = {}, options = {})
  req = build_request(:unlink_developer_identity, params)
  req.send_request(options)
end

Unlinks a federated identity from an existing account. Unlinked logins will be considered new identities next time they are seen. Removing the last linked login will make this identity inaccessible.

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

Examples:

Request syntax with placeholder values


resp = client.unlink_identity({
  identity_id: "IdentityId", # required
  logins: { # required
    "IdentityProviderName" => "IdentityProviderToken",
  },
  logins_to_remove: ["IdentityProviderName"], # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :identity_id (required, String)

    A unique identifier in the format REGION:GUID.

  • :logins (required, Hash<String,String>)

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

  • :logins_to_remove (required, Array<String>)

    Provider names to unlink from this identity.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



1030
1031
1032
1033
# File 'gems/aws-sdk-cognitoidentity/lib/aws-sdk-cognitoidentity/client.rb', line 1030

def unlink_identity(params = {}, options = {})
  req = build_request(:unlink_identity, params)
  req.send_request(options)
end

#update_identity_pool(params = {}) ⇒ Types::IdentityPool

Updates a user pool.

You must use AWS Developer credentials to call this API.

Examples:

Request syntax with placeholder values


resp = client.update_identity_pool({
  identity_pool_id: "IdentityPoolId", # required
  identity_pool_name: "IdentityPoolName", # required
  allow_unauthenticated_identities: false, # required
  supported_login_providers: {
    "IdentityProviderName" => "IdentityProviderId",
  },
  developer_provider_name: "DeveloperProviderName",
  open_id_connect_provider_arns: ["ARNString"],
  cognito_identity_providers: [
    {
      provider_name: "CognitoIdentityProviderName",
      client_id: "CognitoIdentityProviderClientId",
      server_side_token_check: false,
    },
  ],
  saml_provider_arns: ["ARNString"],
})

Response structure


resp.identity_pool_id #=> String
resp.identity_pool_name #=> String
resp.allow_unauthenticated_identities #=> Boolean
resp. #=> Hash
resp.["IdentityProviderName"] #=> String
resp.developer_provider_name #=> String
resp.open_id_connect_provider_arns #=> Array
resp.open_id_connect_provider_arns[0] #=> String
resp.cognito_identity_providers #=> Array
resp.cognito_identity_providers[0].provider_name #=> String
resp.cognito_identity_providers[0].client_id #=> String
resp.cognito_identity_providers[0].server_side_token_check #=> Boolean
resp.saml_provider_arns #=> Array
resp.saml_provider_arns[0] #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :identity_pool_id (required, String)

    An identity pool ID in the format REGION:GUID.

  • :identity_pool_name (required, String)

    A string that you provide.

  • :allow_unauthenticated_identities (required, Boolean)

    TRUE if the identity pool supports unauthenticated logins.

  • :supported_login_providers (Hash<String,String>)

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

  • :developer_provider_name (String)

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

  • :open_id_connect_provider_arns (Array<String>)

    A list of OpendID Connect provider ARNs.

  • :cognito_identity_providers (Array<Types::CognitoIdentityProvider>)

    A list representing an Amazon Cognito Identity User Pool and its client ID.

  • :saml_provider_arns (Array<String>)

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

Returns:

See Also:



1118
1119
1120
1121
# File 'gems/aws-sdk-cognitoidentity/lib/aws-sdk-cognitoidentity/client.rb', line 1118

def update_identity_pool(params = {}, options = {})
  req = build_request(:update_identity_pool, params)
  req.send_request(options)
end