public function impersonate(
        $access_token,
        $user_id,
        $protocol,
        $impersonator_id,
        $client_id,
        array $additionalParameters = []
    )
    {
        $data = [
            'protocol' => $protocol,
            'impersonator_id' => $impersonator_id,
            'client_id' => $client_id,
            'additionalParameters' => $additionalParameters,
        ];

        return $this->apiClient->post()
            ->users($user_id)
            ->impersonate()
            ->withHeader(new ContentType('application/json'))
            ->withHeader(new AuthorizationBearer($access_token))
            ->withBody(json_encode($data))
            ->call();
    }
public function impersonate(
        $access_token,
        $user_id,
        $protocol,
        $impersonator_id,
        $client_id,
        array $additionalParameters = []
    )
    {
        $data = [
            'protocol' => $protocol,
            'impersonator_id' => $impersonator_id,
            'client_id' => $client_id,
            'additionalParameters' => $additionalParameters,
        ];

        return $this->apiClient->post()
            ->users($user_id)
            ->impersonate()
            ->withHeader(new ContentType('application/json'))
            ->withHeader(new AuthorizationBearer($access_token))
            ->withBody(json_encode($data))
            ->call();
    }
public function impersonate ( $ access_token , $ user_id , $ protocol , $ impersonator_id , $ client_id , array $ additionalParameters = [ ] ) { $ data = [ 'protocol' => $ protocol , 'impersonator_id' => $ impersonator_id , 'client_id' => $ client_id , 'additionalParameters' => $ additionalParameters , ] ; return $ this -> apiClient -> post ( ) -> users ( $ user_id ) -> impersonate ( ) -> withHeader ( new ContentType ( 'application/json' ) ) -> withHeader ( new AuthorizationBearer ( $ access_token ) ) -> withBody ( json_encode ( $ data ) ) -> call ( ) ; }
Obtain an impersonation URL to login as another user.
Impersonation functionality may be disabled by default for your tenant.

@deprecated 5.4.0, legacy authentication pipeline, no alternative provided.

@param string $access_token
@param string $user_id
@param string $protocol
@param string $impersonator_id
@param string $client_id
@param array  $additionalParameters

@return mixed

@see https://auth0.com/docs/api/authentication#impersonation

@codeCoverageIgnore - Deprecated
Obtain an impersonation URL to login as another user . Impersonation functionality may be disabled by default for your tenant .