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
Requires (Dev)
- phpunit/phpunit: 3.7.*
- squizlabs/php_codesniffer: 1.*
This package is auto-updated.
Last update: 2024-11-10 23:36:17 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
- 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 }