Laravel Artisan Generators for OAuth1/OAuth2 Providers

v4.7.0 2024-03-23 02:22 UTC

README

Scrutinizer Code Quality Latest Stable Version Total Downloads Latest Unstable Version License

内容

关于

一个Laravel包,用于生成与Socialite Providers Manager兼容的OAuth1/OAuth2提供商。

安装

1. Composer

composer require socialiteproviders/generators

2. 服务提供者

将服务提供者添加到 config/app.php 文件中的 providers 数组。

'providers' => [
    SocialiteProviders\Generators\GeneratorsServiceProvider::class,
],

用法

生成OAuth1提供商

php artisan make:socialite Dropbox --spec=oauth1 --author=YourName --email=your@name.com

带有URLs的OAuth1提供商生成

php artisan make:socialite Dropbox --spec=oauth1 --author=YourName --email=your@name.com --request_token_url=http://myapp.io/oauth/request_token --authorize_url=http://myapp.io/oauth/authorize --access_token_url=http://myapp.io/oauth/access_token --user_details_url=http://myapp.io/users/me

生成OAuth2提供商

php artisan make:socialite Dropbox --spec=oauth2 --author=YourName --email=your@name.com

带有URLs和作用域的OAuth2提供商生成

php artisan make:socialite Dropbox --spec=oauth2 --author=YourName --email=your@name.com --scopes=basic --authorize_url=http://myapp.io/oauth/authorize --access_token_url=http://myapp.io/oauth/access_token --user_details_url=http://myapp.io/users/me