mnastalski/allegro-socialite
Composer 安装命令:
composer require mnastalski/allegro-socialite
包简介
Allegro OAuth2 Provider for Laravel Socialite
README 文档
README
Allegro OAuth2 Provider for Laravel Socialite.
Requirements
- PHP >=7.4
Installation
composer require mnastalski/allegro-socialite
Usage
Add configuration to config/services.php
'allegro' => [ 'client_id' => env('ALLEGRO_CLIENT_ID'), 'client_secret' => env('ALLEGRO_CLIENT_SECRET'), 'redirect' => env('ALLEGRO_REDIRECT'), ],
To make sandbox mode configurable you can add the following to the above configuration:
'sandbox' => env('ALLEGRO_SANDBOX', false),
Example usage:
use Laravel\Socialite\Facades\Socialite; $provider = Socialite::driver('allegro'); $provider->redirect(); $provider->user(); $provider->getAccessToken();
For $provider->user() to work the allegro:api:profile:read permission must be granted.
Refreshing the access token:
Socialite::driver('allegro')->getRefreshTokenResponse($refreshToken);
Example response:
[
'access_token' => '...',
'token_type' => 'bearer',
'refresh_token' => '...',
'expires_in' => 43199,
'scope' => 'allegro:api:profile:read',
'allegro_api' => true,
'jti' => '...',
]
统计信息
- 总下载量: 542
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-05-11