get_open_id_token_for_developer_identity
async
¶
get_open_id_token_for_developer_identity(
identity_pool_id: IdentityPoolId,
logins: LoginsMap,
*,
config_overrides: Optional[AsyncCognitoIdentityClientConfig] = None,
identity_id: Optional[IdentityId] = None,
principal_tags: Optional[PrincipalTags] = None,
token_duration: Optional[TokenDuration] = None,
) -> 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 Amazon Web Services developer credentials to call this operation.
Parameters:
-
identity_pool_id(IdentityPoolId) –An identity pool ID in the format REGION:GUID.
-
identity_id(Optional[IdentityId], default:None) –A unique identifier in the format REGION:GUID.
-
logins(LoginsMap) –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. -
principal_tags(Optional[PrincipalTags], default:None) –Use this operation to configure attribute mappings for custom providers.
-
token_duration(Optional[TokenDuration], default:None) –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 Amazon Web Services 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 Amazon Web Services resources for the token's duration.
Please provide for a small grace period, usually no more than 5 minutes, to account for clock skew.
Raises:
-
DeveloperUserAlreadyRegisteredException–The provided developer user identifier is already registered with Cognito under a different identity ID.
-
InternalErrorException–Thrown when the service encounters an error during processing the request.
-
InvalidParameterException–Thrown for missing or bad input parameter(s).
-
NotAuthorizedException–Thrown when a user is not authorized to access the requested resource.
-
ResourceConflictException–Thrown when a user tries to use a login which is already linked to another account.
-
ResourceNotFoundException–Thrown when the requested resource (for example, a dataset or record) does not exist.
-
TooManyRequestsException–Thrown when a request is throttled.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_cognito_identity/_services/async_cognito_identity.py
792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 | |