UnlinkIdentity - Amazon Cognito Federated Identities
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

UnlinkIdentity

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.

Request Syntax

{ "IdentityId": "string", "Logins": { "string" : "string" }, "LoginsToRemove": [ "string" ] }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

IdentityId

A unique identifier in the format REGION:GUID.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 55.

Pattern: [\w-]+:[0-9a-f-]+

Required: Yes

Logins

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

Type: String to string map

Map Entries: Maximum number of 10 items.

Key Length Constraints: Minimum length of 1. Maximum length of 128.

Value Length Constraints: Minimum length of 1. Maximum length of 50000.

Required: Yes

LoginsToRemove

Provider names to unlink from this identity.

Type: Array of strings

Length Constraints: Minimum length of 1. Maximum length of 128.

Required: Yes

Response Elements

If the action is successful, the service sends back an HTTP 200 response with an empty HTTP body.

Errors

For information about the errors that are common to all actions, see Common Errors.

ExternalServiceException

An exception thrown when a dependent service such as Facebook or Twitter is not responding

HTTP Status Code: 400

InternalErrorException

Thrown when the service encounters an error during processing the request.

HTTP Status Code: 500

InvalidParameterException

Thrown for missing or bad input parameter(s).

HTTP Status Code: 400

NotAuthorizedException

Thrown when a user is not authorized to access the requested resource.

HTTP Status Code: 400

ResourceConflictException

Thrown when a user tries to use a login which is already linked to another account.

HTTP Status Code: 400

ResourceNotFoundException

Thrown when the requested resource (for example, a dataset or record) does not exist.

HTTP Status Code: 400

TooManyRequestsException

Thrown when a request is throttled.

HTTP Status Code: 400

Examples

UnlinkIdentity

The following example shows an UnlinkIdentity request. The request body has been formatted for readability and may not match the content-length value.

Sample Request

POST / HTTP/1.1 CONTENT-TYPE: application/json CONTENT-LENGTH: 307 X-AMZ-TARGET: com.amazonaws.cognito.identity.model.AWSCognitoIdentityService.UnlinkIdentity HOST: <endpoint> X-AMZ-DATE: 20140805T164904Z { "IdentityId": "us-east-1:6820d0d3-3c95-4d9f-8813-c4448fca995f", "Logins": { "accounts.google.com": "<PROVIDER_TOKEN>" }, "LoginsToRemove": ["accounts.google.com"] }

See Also

For more information about using this API in one of the language-specific Amazon SDKs, see the following: