2017 © Pedro Peláez
 

package oauth2

laravel 5 oauth

image

fts/oauth2

laravel 5 oauth

  • Sunday, July 15, 2018
  • by fts3232
  • Repository
  • 1 Watchers
  • 0 Stars
  • 4 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

oauth2

Latest Stable Version Total Downloads License, (*1)

功能

  • 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 数组:, (*2)

fts\OAuth2\OAuthServiceProvider.php::class

中间件

打开 app/Http/Kernel.php 并添加以下内容到 routeMiddleware 数组:, (*3)

'oauth' => fts\OAuth2\Middleware\OAuth2::class

用法

 Router::middleware('oauth')->get('');

The Versions