ahmedd-ibrahim / oauth2
PHP OAUTH2 API
0.4
2022-03-24 10:51 UTC
Requires
- php: ^5.6 | ^7.0 | >=8.0.0
- guzzlehttp/guzzle: ^6.0 | >=7.2.0
Requires (Dev)
This package is auto-updated.
Last update: 2024-12-24 16:53:02 UTC
README
This package may help developers to handel Oauth in a simple way
install
composer require ahmedd-ibrahim/oauth2
Usage
<?php
class YourOwnClass extends Oauth
{
public function __construct(array $requesrParam, $clientConfig = []) {
parent::__construct($requesrParam, $clientConfig);
Oauth::$authTokenUrl = 'https://accounts.zoho.com/oauth/v2/token?';
}
}
Get Access Token
<?php
$param = [
'client_id' => env('CLIENT_ID'),
'client_secret' => env('CLINET_SECRET'),
'grant_type' => 'refresh_token',
'redirect_uri' => env('REDIRECT_URI'),
'currentUserEmail' => env('EMAIL'),
];
return (new YourOwnClass($param))->accessToken();