xxtime/oauth-client

此包最新版本(1.1.0)没有可用的许可信息。

oauth2.0 客户端

1.1.0 2019-11-12 02:52 UTC

This package is auto-updated.

Last update: 2024-09-15 16:41:04 UTC


README

Oauth-client 用于后端服务器上第三方账号登录验证。
它支持 Google、Facebook、微信、微博等。

安装

composer require xxtime/oauth-client

如何使用

$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();
}