kolyunya/oauth2-validation

该库为各种平台的OAuth2访问令牌验证提供了统一的API。也就是说,使用该库可以检查您从客户端收到的访问令牌是否适用于特定平台的特定用户。

dev-master 2015-02-11 10:38 UTC

This package is auto-updated.

Last update: 2024-09-10 23:21:39 UTC


README

描述

该库为各种平台的OAuth2访问令牌验证提供了统一的API。也就是说,使用该库可以检查您从客户端收到的访问令牌是否适用于特定平台的特定用户。

支持的平台

  • Facebook
  • Google
  • Vkontakte

使用示例

$userId = "User's Google ID";
$userToken = "Users's access token to your application";
$clientId = "Your Google application ID";
$googleClient = new GoogleClient($clientId);
$authenticated = $googleClient->validate($userId, $userToken);
if ($authenticated) {
    // User provided valid authentication credentials
} else {
    // User provided invalid authentication credentials
}

构建状态

Build Status License