Learn how Auth for GenAI enables AI agents to link user accounts.
identities
array. A user can have multiple identities associated with various identity providers.
Account linking is the process of linking multiple identities in a single user profile. As a result, users can log into supported identity providers with a single set of credentials instead of creating a separate user account for each identity provider. To learn more, read Account linking.
In Client-initiated account linking, the client initiates the account linking request to Auth0 on the user’s behalf. When the client attempts to access an external provider’s API that the user has not granted access to, Auth0 returns a response that it cannot find the access token for that service, triggering the account linking flow.
Create an Auth0 Account and a Dev Tenant
Create Account Linking Application
Add Account Linking Action
tokenset_not_found
response./authorize
, the Client-Initiated Account Linking post-login
Action checks for the link_account
scope and attempts to link the requested user account (secondary account) with their existing logged in account (primary account). In our example, the user’s Auth0 account is the primary account and the user’s Google account is the secondary account.
link_account
scope along with the following parameters:Parameter | Description |
---|---|
scope | Set to link_account to link accounts. |
requested_connection | The name of the connection you want to link accounts with. |
requested_connection_scope | The requested connection’s scopes. |
id_token_hint | The ID token issued for the primary user. |
identities
array. If a linked account for the requested connection already exists, the Action exits the account linking flow.id_token_hint
by verifying that its sub
claim matches the session’s user ID. Note that the ID token shouldn’t be older than the expiration defined in the exp
claim.identities
array.