Skip to content
Max Kovpak edited this page Apr 15, 2020 · 2 revisions

Get authorised user data

require_once 'vendor/autoload.php';

use Brainfab\MoyGrafik\MoyGrafik;

$OAUTH2_CLIENT_ID = 'your client id';
$OAUTH2_CLIENT_SECRET = 'your client secret';

$client = new MoyGrafik();
$client->setClientId($OAUTH2_CLIENT_ID);
$client->setClientSecret($OAUTH2_CLIENT_SECRET);

$client->authenticate([
    'grant_type' => 'password',
    'username'   => 'your email',
    'password'   => 'your password',
]);

$me = $client->users()->me();
Clone this wiki locally