You are here

public function Authentication::authorize_with_ro in Auth0 Single Sign On 8.2

DEPRECATED - This endpoint is part of the legacy authentication pipeline and has been replaced in favor of the Password Grant. For more information on the latest authentication pipeline refer to Introducing OIDC Conformant Authentication.

@codeCoverageIgnore - Deprecated

Parameters

string $username:

string $password:

string $scope:

null|string $connection:

null|string $id_token:

null|string $device:

Return value

mixed

Throws

ApiException

Deprecated

5.0.0, use `login` instead. Use only for passwordless verify

See also

https://auth0.com/docs/api/authentication#resource-owner

https://auth0.com/docs/api-auth/intro

2 calls to Authentication::authorize_with_ro()
Authentication::email_code_passwordless_verify in vendor/auth0/auth0-php/src/API/Authentication.php
Verify email code
Authentication::sms_code_passwordless_verify in vendor/auth0/auth0-php/src/API/Authentication.php
Verify SMS code

File

vendor/auth0/auth0-php/src/API/Authentication.php, line 798

Class

Authentication
Class Authentication

Namespace

Auth0\SDK\API

Code

public function authorize_with_ro($username, $password, $scope = 'openid', $connection = null, $id_token = null, $device = null) {
  $data = [
    'client_id' => $this->client_id,
    'username' => $username,
    'password' => $password,
    'scope' => $scope,
  ];
  if ($device !== null) {
    $data['device'] = $device;
  }
  if ($id_token !== null) {
    $data['id_token'] = $id_token;
    $data['grant_type'] = 'urn:ietf:params:oauth:grant-type:jwt-bearer';
  }
  else {
    if ($connection === null) {
      throw new ApiException('You need to specify a connection for grant_type=password authentication');
    }
    $data['grant_type'] = 'password';
    $data['connection'] = $connection;
  }
  return $this->apiClient
    ->method('post')
    ->addPath('oauth')
    ->addPath('ro')
    ->withBody(json_encode($data))
    ->call();
}