xxtime/oauth-client

There is no license information available for the latest version (1.1.0) of this package.

oauth2.0 client

1.1.0 2019-11-12 02:52 UTC

This package is auto-updated.

Last update: 2024-04-15 15:52:58 UTC


README

Oauth-client is use for the third-part account login verify on the backend server.
It support Google, Facebook, Weixin, Weibo etc.

Install

composer require xxtime/oauth-client

How to use it

$id = '{Google account id}';
$token = '{Google login account token}';
$option = [
    'clientId' => '{Google app id}'
];
try {
    $oauth = new OauthAdaptor('google', $option);
    $user = $oauth->verify($id, $token);
    print_r($user);
} catch (\Exception $e) {
    echo $e->getMessage();
}