drewhammond / oauth2-brivo
Brivo Provider for OAuth2 client
Installs: 3 031
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 3
Forks: 1
Open Issues: 0
Requires
- league/oauth2-client: ^2.3
Requires (Dev)
- mockery/mockery: ^1.0
- phpunit/phpunit: ^6.5
- squizlabs/php_codesniffer: ^3.2
This package is not auto-updated.
Last update: 2024-11-10 05:56:36 UTC
README
This package provides Brivo OnAir OAuth 2.0 support for the PHP League's OAuth 2.0 Client.
Installation
To install, use composer:
$ composer require drewhammond/oauth2-brivo
Usage
The example below is taken from a Laravel project with the BRIVO_CLIENT_ID
and BRIVO_CLIENT_SECRET
defined in the project .env file.
$provider = new \Drewhammond\OAuth2\Client\Provider\Brivo([ 'clientId' => getenv('BRIVO_CLIENT_ID'), 'clientSecret' => getenv('BRIVO_CLIENT_SECRET'), ]); // Using the password grant type $accessToken = $provider->getAccessToken('password', [ 'username' => getenv('BRIVO_USERNAME'), 'password' => getenv('BRIVO_PASSWORD'), ]); // Do something with your access token... $token = $accessToken->getToken(); $expires = $accessToken->getExpires();
Support
Please open a new issue if you run into any problems.
License
MIT License
Copyright (c) 2018 Drew Hammond