Client Credentials Grant Tokens: Retrieving Tokens

$guzzle = new GuzzleHttp\Client;

$response = $guzzle->post('http://your-app.com/oauth/token', [
    'form_params' => [
        'grant_type' => 'client_credentials',
        'client_id' => 'client-id',
        'client_secret' => 'client-secret',
        'scope' => 'your-scope',
    ],
]);

return json_decode((string) $response->getBody(), true)['access_token'];

Client Credentials Grant Tokens: Retrieving Tokens — Structure map

Clickable & Draggable!

Client Credentials Grant Tokens: Retrieving Tokens — Related pages: