fts / oauth2
laravel 5 oauth
Installs: 14
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:package
Requires
- php: >=5.4
- bshaffer/oauth2-server-httpfoundation-bridge: ^1.3
- bshaffer/oauth2-server-php: ^1.10.0
- illuminate/filesystem: ~5.0
- illuminate/hashing: ~5.0
- symfony/http-foundation: 2.6 - 4
This package is auto-updated.
Last update: 2024-12-15 23:14:02 UTC
README
功能
- oauth2.0授权
安装
composer require fts/oauth
发布配置文件和公钥私钥
php artisan vendor:publish
创建公钥和私钥
# private key
$ openssl genrsa -out privkey.pem 2048
# public key
$ openssl rsa -in privkey.pem -pubout -out pubkey.pem
添加服务提供者
打开 config/app.php
并添加以下内容到 providers 数组:
fts\OAuth2\OAuthServiceProvider.php::class
中间件
打开 app/Http/Kernel.php
并添加以下内容到 routeMiddleware 数组:
'oauth' => fts\OAuth2\Middleware\OAuth2::class
用法
Router::middleware('oauth')->get('');