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.

Home Page:https://packagist.org/packages/kolyunya/oauth2-validation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

OAuth validation

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

About

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.

https://packagist.org/packages/kolyunya/oauth2-validation

License:GNU General Public License v3.0


Languages

Language:PHP 97.1%Language:Perl 2.9%