douglasresendemaciel/oauth2-client
Composer 安装命令:
composer require douglasresendemaciel/oauth2-client
包简介
OAUTH2 client for laravel
README 文档
README
This package is used to consume OAuth2 API´s from Laravel
Installation
Run the following command from you terminal:
composer require "douglasresendemaciel/oauth2-client:@dev"
or add this to require section in your composer.json file:
"douglasresendemaciel/oauth2-client"
then run composer update
Once it is installed, you need to register the service provider. Open up config/app.php and add the following to the providers key.
'providers' => [ ... DouglasResende\OAuth2Client\OAuth2ClientServiceProvider::class ...
Publishing config file
php artisan vendor:publish
Usage
$oauth2Client = new \DouglasResende\OAuth2Client\OAuth2Client(); # METHODS TO GET TOKEN // https://laravel.com/docs/5.7/passport // authorization_code $oauth2 = $oauth2Client->withOAuthTokenTypeAuthorizationCode('client-id', 'client-secret', 'redirect-url', 'code'); // client_credentials $oauth2 = $oauth2Client->withOAuthTokenTypeClientCredentials('client-id', 'client-secret','scope'); // password $oauth2 = $oauth2Client->withOAuthTokenTypePassword('client-id', 'client-secret', 'username', 'password', 'scope'); // GET RESPONSE $response = $oauth2Client->get("user")->getResponseAsArray();
Author
Douglas Resende: http://www.douglasresende.com/
License
The MIT License (MIT). Please see License File for more information.
References
For more information read the official documentation at https://laravel.com/docs/5.7/
统计信息
- 总下载量: 888
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-01-08