You are here

public function Users::linkAccount in Auth0 Single Sign On 8.2

Link one user identity to another. Required scope: "update:users"

@link https://auth0.com/docs/api/management/v2#!/Users/post_identities

Parameters

string $user_id User ID of the primary account.:

array $data An array with the following fields::

  • "provider" - Secondary account provider.
  • "user_id" - Secondary account user ID.
  • "connection_id" - Secondary account Connection ID (optional).

Return value

array Array of the primary account identities after the merge.

Throws

\Exception Thrown by the HTTP client when there is a problem with the API call.

File

vendor/auth0/auth0-php/src/API/Management/Users.php, line 187

Class

Users
Class Users. Handles requests to the Users endpoint of the v2 Management API.

Namespace

Auth0\SDK\API\Management

Code

public function linkAccount($user_id, array $data) {
  return $this->apiClient
    ->method('post')
    ->addPath('users', $user_id)
    ->addPath('identities')
    ->withBody(json_encode($data))
    ->call();
}