Table of Contents

Interface IIdentitiesClient

Namespace
Auth0.ManagementApi.Users
Assembly
Auth0.ManagementApi.dll
public interface IIdentitiesClient
Extension Methods

Methods

DeleteAsync(string, UserIdentityProviderEnum, string, RequestOptions?, CancellationToken)

Unlink a specific secondary account from a target user. This action requires the ID of both the target user and the secondary account.

Unlinking the secondary account removes it from the identities array of the target user and creates a new standalone profile for the secondary account. To learn more, review Unlink User Accounts.

WithRawResponseTask<IEnumerable<DeleteUserIdentityResponseContentItem>> DeleteAsync(string id, UserIdentityProviderEnum provider, string userId, RequestOptions? options = null, CancellationToken cancellationToken = default)

Parameters

id string
provider UserIdentityProviderEnum
userId string
options RequestOptions
cancellationToken CancellationToken

Returns

WithRawResponseTask<IEnumerable<DeleteUserIdentityResponseContentItem>>

LinkAsync(string, LinkUserIdentityRequestContent, RequestOptions?, CancellationToken)

Link two user accounts together forming a primary and secondary relationship. On successful linking, the endpoint returns the new array of the primary account identities.

Note: There are two ways of invoking the endpoint:

  • With the authenticated primary account's JWT in the Authorization header, which has the update:current_user_identities scope:
    <pre><code class="lang-csharp">POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
    

    Authorization: "Bearer PRIMARY_ACCOUNT_JWT" { "link_with": "SECONDARY_ACCOUNT_JWT" }

    In this case, only the <code>link_with</code> param is required in the body, which also contains the JWT obtained upon the secondary account's authentication.
    
  • With a token generated by the API V2 containing the update:users scope:
    <pre><code class="lang-csharp">POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
    

    Authorization: "Bearer YOUR_API_V2_TOKEN" { "provider": "SECONDARY_ACCOUNT_PROVIDER", "connection_id": "SECONDARY_ACCOUNT_CONNECTION_ID(OPTIONAL)", "user_id": "SECONDARY_ACCOUNT_USER_ID" }

    In this case you need to send <code>provider</code> and <code>user_id</code> in the body. Optionally you can also send the <code>connection_id</code> param which is suitable for identifying a particular database connection for the 'auth0' provider.
    
WithRawResponseTask<IEnumerable<UserIdentity>> LinkAsync(string id, LinkUserIdentityRequestContent request, RequestOptions? options = null, CancellationToken cancellationToken = default)

Parameters

id string
request LinkUserIdentityRequestContent
options RequestOptions
cancellationToken CancellationToken

Returns

WithRawResponseTask<IEnumerable<UserIdentity>>