Auth0 Node.js SDK - v5.0.0
    Preparing search index...

    Class Identities

    Index

    Constructors

    Methods

    • 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:
              POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities
              Authorization: "Bearer PRIMARY_ACCOUNT_JWT"
              {
                "link_with": "SECONDARY_ACCOUNT_JWT"
              }
            
        In this case, only the link_with 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:
            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 provider and user_id in the body. Optionally you can also send the connection_id param which is suitable for identifying a particular database connection for the 'auth0' provider.

      Parameters

      Returns HttpResponsePromise<UserIdentity[]>

    • Returns Promise<string>

    Properties