You are here

public function Clients::get in Auth0 Single Sign On 8.2

Get a single Client by ID. Required scopes:

  • "read:clients" - For any call to this endpoint.
  • "read:client_keys" - To retrieve "client_secret" and "encryption_key" attributes.

@link https://auth0.com/docs/api/management/v2#!/Clients/get_clients_by_id

Parameters

string $client_id Client ID to get.:

null|string|array $fields Fields to include or exclude from the result::

  • Including only the fields required can speed up API calls significantly.
  • Arrays will be converted to comma-separated strings.

null|boolean $include_fields True to include $fields, false to exclude $fields.:

Return value

mixed

Throws

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

File

vendor/auth0/auth0-php/src/API/Management/Clients.php, line 84

Class

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

Namespace

Auth0\SDK\API\Management

Code

public function get($client_id, $fields = null, $include_fields = null) {
  $params = [];

  // Results fields.
  if (!empty($fields)) {
    $params['fields'] = is_array($fields) ? implode(',', $fields) : $fields;
    if (null !== $include_fields) {
      $params['include_fields'] = $include_fields;
    }
  }
  return $this->apiClient
    ->method('get')
    ->addPath('clients', $client_id)
    ->withDictParams($params)
    ->call();
}