Skip to content

Instantly share code, notes, and snippets.

@JeroenJochems
Created November 28, 2016 13:01
Show Gist options
  • Save JeroenJochems/bb8348c72e2da42e6e1e997490243dae to your computer and use it in GitHub Desktop.
Save JeroenJochems/bb8348c72e2da42e6e1e997490243dae to your computer and use it in GitHub Desktop.
Password grant
$http = new GuzzleHttp\Client;
$response = $http->post('https://l1nda:t3mp3r@dev1.temper.works/oauth/token', [
'form_params' => [
'grant_type' => 'password',
'client_id' => '3',
'client_secret' => 'QVPm9nGWGQJcgofqkpIvpEnOucWso0E1io4RhQgv',
'username' => 'client@example.net',
'password' => 'secret',
'scope' => '',
],
]);
return json_decode((string) $response->getBody(), true);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment