PHP code example of superbrave / auth0-http-client

1. Go to this page and download the library: Download superbrave/auth0-http-client library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

superbrave / auth0-http-client example snippets




use Superbrave\AuthZeroHttpClient\AuthZeroAuthenticatingHttpClient;
use Superbrave\AuthZeroHttpClient\AuthZeroConfiguration;
use Symfony\Component\HttpClient\HttpClient;

$httpClient = HttpClient::create();
$authZeroConfiguration = new AuthZeroConfiguration(
    'https://dev-1234.eu.auth0.com', // Your Auth0 tenant URL
    'clientId',                      // Your application's Client ID
    'clientSecret',                  // Your application's Client Secret
    'https://www.superbrave.nl/api'  // The unique identifier of the target API you want to access
);

$authZeroHttpClient = new AuthZeroAuthenticatingHttpClient($httpClient, $authZeroConfiguration);

$response = $authZeroHttpClient->request('GET', 'https://superbrave.nl/api');