kolyunya/oauth2-validation

The library provides a uniform API for validation of OAuth2 access tokens of various platforms. That is using the library you can check if the access token you receive from the client is valid for a specific user of a platform.

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

This package is auto-updated.

Last update: 2024-12-10 23:53:02 UTC


README

Description

The library provides a uniform API for validation of OAuth2 access tokens of various platforms. That is using the library you can check if the access token you receive from the client is valid for a specific user of a platform.

Supported platforms

  • Facebook
  • Google
  • Vkontakte

Usage example

$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

Build Status License