Giter Club home page Giter Club logo

oauth2-server-lumen's Introduction

oauth2-server-lumen

A Lumen bridge for lucadegasperi/oauth2-server-laravel.

Guide

I have written an extensive blog post on it's use here.

Building a web app with Lumen web API and OAuth2 authentication

Installation

Via composer

Run composer require optimus/oauth2-server-lumen 0.1.*

Register package

In your bootstrap/app.php register service providers

$app->register('LucaDegasperi\OAuth2Server\Storage\FluentStorageServiceProvider');
$app->register('Optimus\OAuth2Server\OAuth2ServerServiceProvider');

... and middleware

$app->middleware([
    'LucaDegasperi\OAuth2Server\Middleware\OAuthExceptionHandlerMiddleware'
]);

... and route middleware

$app->routeMiddleware([
    'check-authorization-params' => 'Optimus\OAuth2Server\Middleware\CheckAuthCodeRequestMiddleware',
    'csrf' => 'Laravel\Lumen\Http\Middleware\VerifyCsrfToken',
    'oauth' => 'Optimus\OAuth2Server\Middleware\OAuthMiddleware',
    'oauth-owner' => 'Optimus\OAuth2Server\Middleware\OAuthOwnerMiddleware'
]);

Copy config

Copy vendor/lucadegasperi/oauth2-server-laravel/config/oauth2.php to your own config folder (config/oauth2.php in your project root). It has to be the correct config folder as it is registered using $app->configure().

Migrate

Run php artisan migrate --path=vendor/lucadegasperi/oauth2-server-laravel/migrations

If you get an error saying the Config class can not be found, add class_alias('Illuminate\Support\Facades\Config', 'Config'); to your bootstrap/app.php file and uncomment $app->withFacades(); temporarily to import the migrations.

Usage

The package is now installed for Lumen. Usage is the same as with lucadegasperi/oauth2-server-laravel, so I suggest you read the wiki for usage.

oauth2-server-lumen's People

Contributors

esbenp avatar sorora avatar olavocneto avatar

Watchers

Wouter Krooshof avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.