Demo entry 6628618

test

   

Submitted by anonymous on Jul 04, 2017 at 19:39
Language: PHP. Code size: 528 Bytes.

public function iSignIn ($email, $password)
{
try {
$this->response = $this->client->post('access_token', [
'body' => [
'grant_type' => 'password',
'client_id' => 'client Id or API key',// can be read from environment variable
'client_secret' => 'secret',// can be read from environment variable
'username' => $email,
'password' => $password
]
]);
$token = $this->response->json();
$this->token = $token['access_token'];
} catch (GuzzleHttp\Exception\BadResponseException $e) {
//do something with the error
}
}

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).