the-sett/elm-aws-cognito/3.0.0

NOTE: the latest version is 5.0.0

AWS.CognitoIdentity

Amazon Cognito Federated Identities

Amazon Cognito Federated Identities is a web service that delivers scoped temporary credentials to mobile devices and other untrusted environments. It uniquely identifies a device and supplies the user with a consistent identity over the lifetime of an application.

Using Amazon Cognito Federated Identities, you can enable authentication with one or more third-party identity providers (Facebook, Google, or Login with Amazon) or an Amazon Cognito user pool, and you can also choose to support unauthenticated access from your app. Cognito delivers a unique identifier for each user and acts as an OpenID token provider trusted by AWS Security Token Service (STS) to access temporary, limited-privilege AWS credentials.

For a description of the authentication flow from the Amazon Cognito Developer Guide see Authentication Flow.

For more information see Amazon Cognito Federated Identities.

Service definition.

service : Region -> Service

Configuration for this service.

Service endpoints.

createIdentityPool : CreateIdentityPoolInput -> Request 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.

deleteIdentities : DeleteIdentitiesInput -> Request 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.

deleteIdentityPool : DeleteIdentityPoolInput -> Request ()

Deletes an identity 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.

describeIdentity : DescribeIdentityInput -> Request 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.

describeIdentityPool : DescribeIdentityPoolInput -> Request 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.

GetCredentialsForIdentityInput
-> Request 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.

getId : GetIdInput -> Request 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.

getIdentityPoolRoles : GetIdentityPoolRolesInput -> Request GetIdentityPoolRolesResponse

Gets the roles for an identity pool.

You must use AWS Developer credentials to call this API.

getOpenIdToken : GetOpenIdTokenInput -> Request 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 10 minutes.

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

GetOpenIdTokenForDeveloperIdentityInput
-> Request 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.

listIdentities : ListIdentitiesInput -> Request ListIdentitiesResponse

Lists the identities in an identity pool.

You must use AWS Developer credentials to call this API.

listIdentityPools : ListIdentityPoolsInput -> Request ListIdentityPoolsResponse

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

You must use AWS Developer credentials to call this API.

listTagsForResource : ListTagsForResourceInput -> Request ListTagsForResourceResponse

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.

LookupDeveloperIdentityInput
-> Request LookupDeveloperIdentityResponse

Retrieves the IdentityID associated with a DeveloperUserIdentifier or the list of DeveloperUserIdentifier values 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.

LookupDeveloperIdentity is intended for low-throughput control plane operations: for example, to enable customer service to locate an identity ID by username. If you are using it for higher-volume operations such as user authentication, your requests are likely to be throttled. GetOpenIdTokenForDeveloperIdentity is a better option for higher-volume operations for user authentication.

You must use AWS Developer credentials to call this API.

MergeDeveloperIdentitiesInput
-> Request 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.

The number of linked logins is limited to 20. So, the number of linked logins for the source user, SourceUserIdentifier, and the destination user, DestinationUserIdentifier, together should not be larger than 20. Otherwise, an exception will be thrown.

You must use AWS Developer credentials to call this API.

setIdentityPoolRoles : SetIdentityPoolRolesInput -> Request ()

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.

tagResource : TagResourceInput -> Request ()

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.

unlinkDeveloperIdentity : UnlinkDeveloperIdentityInput -> Request ()

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.

unlinkIdentity : UnlinkIdentityInput -> Request ()

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.

untagResource : UntagResourceInput -> Request ()

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

updateIdentityPool : IdentityPool -> Request IdentityPool

Updates an identity pool.

You must use AWS Developer credentials to call this API.

API data model.

type alias AccessKeyString =
String

The AccessKeyString data model.

The AccountId data model.

= AmbiguousRoleResolutionTypeAuthenticatedRole
| AmbiguousRoleResolutionTypeDeny

The AmbiguousRoleResolutionType data model.

The Arnstring data model.

The ClaimName data model.

The ClaimValue data model.

, providerName : Maybe CognitoIdentityProviderName
, serverSideTokenCheck : Maybe CognitoIdentityProviderTokenCheck
}

The CognitoIdentityProvider data model.

The CognitoIdentityProviderClientId data model.

List CognitoIdentityProvider

The CognitoIdentityProviderList data model.

The CognitoIdentityProviderName data model.

The CognitoIdentityProviderTokenCheck data model.

{ allowUnauthenticatedIdentities : IdentityPoolUnauthenticated
, cognitoIdentityProviders : Maybe CognitoIdentityProviderList
, developerProviderName : Maybe DeveloperProviderName
, identityPoolName : IdentityPoolName
, identityPoolTags : Maybe IdentityPoolTagsType
, openIdConnectProviderArns : Maybe OidcproviderList
, samlProviderArns : Maybe SamlproviderList
, supportedLoginProviders : Maybe IdentityProviders
}

The CreateIdentityPoolInput data model.

type alias Credentials =
{ accessKeyId : Maybe AccessKeyString
, expiration : Maybe DateType
, secretKey : Maybe SecretKeyString
, sessionToken : Maybe SessionTokenString
}

The Credentials data model.

type alias DateType =
String

The DateType data model.

{ identityIdsToDelete : IdentityIdList }

The DeleteIdentitiesInput data model.

{ unprocessedIdentityIds : Maybe UnprocessedIdentityIdList }

The DeleteIdentitiesResponse data model.

{ identityPoolId : IdentityPoolId }

The DeleteIdentityPoolInput data model.

{ identityId : IdentityId }

The DescribeIdentityInput data model.

{ identityPoolId : IdentityPoolId }

The DescribeIdentityPoolInput data model.

The DeveloperProviderName data model.

The DeveloperUserIdentifier data model.

The DeveloperUserIdentifierList data model.

= ErrorCodeAccessDenied
| ErrorCodeInternalServerError

The ErrorCode data model.

{ customRoleArn : Maybe Arnstring
, identityId : IdentityId
, logins : Maybe LoginsMap
}

The GetCredentialsForIdentityInput data model.

{ credentials : Maybe Credentials
, identityId : Maybe IdentityId
}

The GetCredentialsForIdentityResponse data model.

type alias GetIdInput =
{ accountId : Maybe AccountId
, identityPoolId : IdentityPoolId
, logins : Maybe LoginsMap
}

The GetIdInput data model.

type alias GetIdResponse =
{ identityId : Maybe IdentityId }

The GetIdResponse data model.

{ identityPoolId : IdentityPoolId }

The GetIdentityPoolRolesInput data model.

{ identityPoolId : Maybe IdentityPoolId
, roleMappings : Maybe RoleMappingMap
, roles : Maybe RolesMap
}

The GetIdentityPoolRolesResponse data model.

{ identityId : Maybe IdentityId
, identityPoolId : IdentityPoolId
, logins : LoginsMap
, tokenDuration : Maybe TokenDuration
}

The GetOpenIdTokenForDeveloperIdentityInput data model.

{ identityId : Maybe IdentityId
, token : Maybe Oidctoken
}

The GetOpenIdTokenForDeveloperIdentityResponse data model.

type alias GetOpenIdTokenInput =
{ identityId : IdentityId
, logins : Maybe LoginsMap
}

The GetOpenIdTokenInput data model.

{ identityId : Maybe IdentityId
, token : Maybe Oidctoken
}

The GetOpenIdTokenResponse data model.

type alias HideDisabled =
Bool

The HideDisabled data model.

type alias IdentitiesList =
List IdentityDescription

The IdentitiesList data model.

type alias IdentityDescription =
{ creationDate : Maybe DateType
, identityId : Maybe IdentityId
, lastModifiedDate : Maybe DateType
, logins : Maybe LoginsList
}

The IdentityDescription data model.

The IdentityId data model.

type alias IdentityIdList =

The IdentityIdList data model.

type alias IdentityPool =
{ allowUnauthenticatedIdentities : IdentityPoolUnauthenticated
, cognitoIdentityProviders : Maybe CognitoIdentityProviderList
, developerProviderName : Maybe DeveloperProviderName
, identityPoolId : IdentityPoolId
, identityPoolName : IdentityPoolName
, identityPoolTags : Maybe IdentityPoolTagsType
, openIdConnectProviderArns : Maybe OidcproviderList
, samlProviderArns : Maybe SamlproviderList
, supportedLoginProviders : Maybe IdentityProviders
}

The IdentityPool data model.

The IdentityPoolId data model.

The IdentityPoolName data model.

{ identityPoolId : Maybe IdentityPoolId
, identityPoolName : Maybe IdentityPoolName
}

The IdentityPoolShortDescription data model.

The IdentityPoolTagsListType data model.

The IdentityPoolTagsType data model.

Bool

The IdentityPoolUnauthenticated data model.

type alias IdentityPoolsList =
List IdentityPoolShortDescription

The IdentityPoolsList data model.

The IdentityProviderId data model.

The IdentityProviderName data model.

The IdentityProviderToken data model.

The IdentityProviders data model.

type alias ListIdentitiesInput =
{ hideDisabled : Maybe HideDisabled
, identityPoolId : IdentityPoolId
, maxResults : QueryLimit
, nextToken : Maybe PaginationKey
}

The ListIdentitiesInput data model.

{ identities : Maybe IdentitiesList
, identityPoolId : Maybe IdentityPoolId
, nextToken : Maybe PaginationKey
}

The ListIdentitiesResponse data model.

{ maxResults : QueryLimit
, nextToken : Maybe PaginationKey
}

The ListIdentityPoolsInput data model.

{ identityPools : Maybe IdentityPoolsList
, nextToken : Maybe PaginationKey
}

The ListIdentityPoolsResponse data model.

{ resourceArn : Arnstring }

The ListTagsForResourceInput data model.

{ tags : Maybe IdentityPoolTagsType }

The ListTagsForResourceResponse data model.

The LoginsList data model.

The LoginsMap data model.

{ developerUserIdentifier : Maybe DeveloperUserIdentifier
, identityId : Maybe IdentityId
, identityPoolId : IdentityPoolId
, maxResults : Maybe QueryLimit
, nextToken : Maybe PaginationKey
}

The LookupDeveloperIdentityInput data model.

{ developerUserIdentifierList : Maybe DeveloperUserIdentifierList
, identityId : Maybe IdentityId
, nextToken : Maybe PaginationKey
}

The LookupDeveloperIdentityResponse data model.

type alias MappingRule =
{ claim : ClaimName
, matchType : MappingRuleMatchType
, roleArn : Arnstring
, value : ClaimValue
}

The MappingRule data model.

= MappingRuleMatchTypeEquals
| MappingRuleMatchTypeContains
| MappingRuleMatchTypeStartsWith
| MappingRuleMatchTypeNotEqual

The MappingRuleMatchType data model.

type alias MappingRulesList =
List MappingRule

The MappingRulesList data model.

{ destinationUserIdentifier : DeveloperUserIdentifier
, developerProviderName : DeveloperProviderName
, identityPoolId : IdentityPoolId
, sourceUserIdentifier : DeveloperUserIdentifier
}

The MergeDeveloperIdentitiesInput data model.

{ identityId : Maybe IdentityId }

The MergeDeveloperIdentitiesResponse data model.

type alias OidcproviderList =
List Arnstring

The OidcproviderList data model.

type alias Oidctoken =
String

The Oidctoken data model.

The PaginationKey data model.

The QueryLimit data model.

type alias RoleMapping =
{ ambiguousRoleResolution : Maybe AmbiguousRoleResolutionType
, rulesConfiguration : Maybe RulesConfigurationType
, type_ : RoleMappingType
}

The RoleMapping data model.

type alias RoleMappingMap =
Dict String IdentityProviderName RoleMapping

The RoleMappingMap data model.

= RoleMappingTypeToken
| RoleMappingTypeRules

The RoleMappingType data model.

The RoleType data model.

type alias RolesMap =
Dict String RoleType Arnstring

The RolesMap data model.

{ rules : MappingRulesList }

The RulesConfigurationType data model.

type alias SamlproviderList =
List Arnstring

The SamlproviderList data model.

type alias SecretKeyString =
String

The SecretKeyString data model.

type alias SessionTokenString =
String

The SessionTokenString data model.

{ identityPoolId : IdentityPoolId
, roleMappings : Maybe RoleMappingMap
, roles : RolesMap
}

The SetIdentityPoolRolesInput data model.

The TagKeysType data model.

type alias TagResourceInput =
{ resourceArn : Arnstring
, tags : Maybe IdentityPoolTagsType
}

The TagResourceInput data model.

type alias TagResourceResponse =
{}

The TagResourceResponse data model.

The TagValueType data model.

type alias TokenDuration =
Int

The TokenDuration data model.

{ developerProviderName : DeveloperProviderName
, developerUserIdentifier : DeveloperUserIdentifier
, identityId : IdentityId
, identityPoolId : IdentityPoolId
}

The UnlinkDeveloperIdentityInput data model.

type alias UnlinkIdentityInput =
{ identityId : IdentityId
, logins : LoginsMap
, loginsToRemove : LoginsList
}

The UnlinkIdentityInput data model.

{ errorCode : Maybe ErrorCode
, identityId : Maybe IdentityId
}

The UnprocessedIdentityId data model.

List UnprocessedIdentityId

The UnprocessedIdentityIdList data model.

type alias UntagResourceInput =
{ resourceArn : Arnstring
, tagKeys : Maybe IdentityPoolTagsListType
}

The UntagResourceInput data model.

{}

The UntagResourceResponse data model.

accountId : Refined String AccountId StringError

The AccountId data model.

The AmbiguousRoleResolutionType data model.

arnstring : Refined String Arnstring StringError

The Arnstring data model.

claimName : Refined String ClaimName StringError

The ClaimName data model.

claimValue : Refined String ClaimValue StringError

The ClaimValue data model.

The CognitoIdentityProviderClientId data model.

The CognitoIdentityProviderName data model.

developerProviderName : Refined String DeveloperProviderName StringError

The DeveloperProviderName data model.

The DeveloperUserIdentifier data model.

The ErrorCode data model.

identityId : Refined String IdentityId StringError

The IdentityId data model.

identityPoolId : Refined String IdentityPoolId StringError

The IdentityPoolId data model.

identityPoolName : Refined String IdentityPoolName StringError

The IdentityPoolName data model.

identityProviderId : Refined String IdentityProviderId StringError

The IdentityProviderId data model.

identityProviderName : Refined String IdentityProviderName StringError

The IdentityProviderName data model.

identityProviderToken : Refined String IdentityProviderToken StringError

The IdentityProviderToken data model.

The MappingRuleMatchType data model.

paginationKey : Refined String PaginationKey StringError

The PaginationKey data model.

queryLimit : Refined Int QueryLimit IntError

The QueryLimit data model.

The RoleMappingType data model.

roleType : Refined String RoleType StringError

The RoleType data model.

tagKeysType : Refined String TagKeysType StringError

The TagKeysType data model.

tagValueType : Refined String TagValueType StringError

The TagValueType data model.