An OAuth 2.0 bridge for Laravel and Lumen [DEPRECATED FOR LARAVEL 5.3+]

Overview

OAuth 2.0 Server for Laravel (deprecated for Laravel 5.3+)

oauth2-server-laravel

Note: This package is no longer maintaned for Laravel 5.3+ since Laravel now features the Passport package.

OAuth 2.0 authorization server and resource server for the Laravel and Lumen frameworks. Standard compliant thanks to the amazing work by The League of Extraordinary Packages OAuth 2.0 authorization server and resource server.

Latest Version Software License Build Status Coverage Status Quality Score Total Downloads

Note: This package assumes you have a good-enough knowledge of the principles behind the OAuth 2.0 authorization specification.

Version Compatibility

Laravel OAuth Server PHP
4.0.x 1.0.x >= 5.3
4.1.x 1.0.x >= 5.3
4.2.x 3.0.x >= 5.4
5.0.x 4.0.x >= 5.4
5.1.x 5.0.x >= 5.5.9
5.2.x 5.1.x >= 5.5.9

Documentation

This package features an extensive documentation to help you getting started implementing an OAuth 2.0 server in your Laravel application.

Contributing

Bugs and feature request are tracked on GitHub. Please read our contribution guidelines before opening a new issue or submitting a new pull request.

Credits

The code on which this package is based, is principally developed and maintained by Alex Bilbie.

License

The Laravel OAuth 2.0 package is released under the MIT License.

Comments
  • Fix for lumen 5.2

    Fix for lumen 5.2

    The problem is that in Lumen 5.2 (for some reason) Laravel\Lumen\Application no longer implements \Illuminate\Contracts\Foundation\Application.

    This causes the providers LucaDegasperi\OAuth2Server\OAuth2ServerServiceProvider and LucaDegasperi\OAuth2Server\Storage\FluentStorageServiceProvider to fail, since they expect the $app to implement that contract.

    In this PR the type hint $app var is removed from several functions in the providers and use $this->app instead, as that is the most common usage.

    opened by tralves 7
  • MongoDB storage support.

    MongoDB storage support.

    How to use:

    In the app.php file, replace the standard storage service provider with the new storage\mongo service provider.

    LucaDegasperi\OAuth2Server\Storage\Mongo\FluentStorageServiceProvider::class,
    

    What was done:

    • Created Mongo folder inside Storage folder to house concrete classes for mongo support.
    • Rewrote all joins as separate queries since mongo doesn't support joins.
    • Added additional delete queries to simulate sql database cascade delete.

    Other notes:

    • I've tested everything manually, 100% of original functionality should work on mongodb with this patch. I've not written any phpunit test yet.
    • Not total "D.R.Y" as the AbstractFluentAdaptor.php and FluentStorageServiceProvider.php in the Mongo folder is an exact duplicate of the original except for the namespace... the alternative i think would be much more complex (implementing an driver/adapter pattern to swap between different types of databases. sql vs nonsql) or maybe I just can't see the better solution.
    • I've not tested but the patch should make this library work with all other NoSQL database. i.e. this patch really isn't mongodb-specific.
    proposal 
    opened by pengkong 7
  • Fix the client secret requirement issue

    Fix the client secret requirement issue

    The lastest standard, the client-secret are no longer required in PasswordGrant and RefreshToken Grant, thus there will be a circumstance when client_secret and redirect_uri both are null

    proposal 
    opened by saga64 7
  • Moved laravel/framework to require-dev

    Moved laravel/framework to require-dev

    @lucadegasperi I don't understand why you would want to always require laravel/framework. This choice prevents us from using this great library with Lumen, simply because you cannot install both Lumen and Laravel in the same project. I've moved laravel/framework under require-dev to solve this problem.

    This might also fix issue #351 (at least it fixes the composer dependency error) but I have yet to put it all together so I cannot say for sure.

    opened by crisu83 7
  • Implemented JSON error handler using middleware

    Implemented JSON error handler using middleware

    Laravel 5 develop has removed the Exception\Handler implementation so the Handler contract doesn't resolve. This commit refactors the check-authorizaton-params and the error handler into middleware.

    opened by deweller 7
  • Removed need for clientSecret for some grant types

    Removed need for clientSecret for some grant types

    The client_secret shouldn't be necessary when using the password or refresh_token grant types. In the former (in cases where client secrets cannot be stored securely), security is handled on a resource owner level, where users in a (for example) mobile web application can login to an application using their own credentials. In the latter, the new access tokens are retrieved using special "refresh tokens", which are sent back as a part of the regular OAuth2.0 response body when a client has successfully authenticated with some kind of grant_type. Asking the client for a client_secret again is unnecessary in my opinion.

    To create a bit of context for this PR: I've been using this package (with this proposed change) in a mobile webapplication, where resource owners authenticate once (by simply logging in using their email address and password using the password grant) and then just (statelessly) identify themselves using their OAuth2.0 access token. Should the token expire, the client application then simply requests to refresh the token using the refresh_token grant. The whole setup consists of an front-end webapplication and a back-end http://jsonapi.org server, where the communication is done by XHR (with CORS). In all OAuth-related requests, only the client_id is sent back to the server.

    Thoughts?

    question 
    opened by mvdstam 5
  • Add better PSR-2 support

    Add better PSR-2 support

    Also update the license information and added description to all classes.

    Also added .php_cs and .styleci.yml files. StyleCI will check syntax on all PRs and commits done to this repository. @lucadegasperi What do you think about this? Personally I use StyleCI on all my packages. It saves me a lot of time telling people to correct their PRs.

    This closes #475.

    opened by vinkla 5
  • Add compatibility with mongodb storage

    Add compatibility with mongodb storage

    I have modified storage classes and added database queries that are compatible with mongodb databases. After making the changes, I have run phpunit and passed all the tests.

    opened by swaaj 5
  • Input as an optional parameter for performAccessTokenFlow()

    Input as an optional parameter for performAccessTokenFlow()

    Throughout various parts of the application it is sometimes mandatory to perform manual authentication using the credentials and all other parameters (grant_type, client_id, etc). $input should be an optional parameter to the performAccessTokenFlow() method.

    opened by ghost 5
  • Converting PDO results into objects

    Converting PDO results into objects

    The package was not working when the database.php config file had 'fetch' assigned as "PDO::FETCH_ASSOC" because the package was assuming that PDO is returning an object.

    This pull request fixes the bug by typecasting PDO results in to an object for further use.

    opened by mohitmamoria 5
  • Fixed a bug that was causing requests for an access token to fail when u...

    Fixed a bug that was causing requests for an access token to fail when u...

    Fixed a bug that was causing requests for an access token to fail when using oauth internally. For example, I'm building an API that is being used by my application internally, but still authorising using client_credentials.

    This bug was causing an error when trying to retrieve an access token; was telling me that required parameters.

    opened by enginego 5
Releases(5.2.1)
EAuth extension allows to authenticate users by the OpenID, OAuth 1.0 and OAuth 2.0 providers

EAuth extension allows to authenticate users with accounts on other websites. Supported protocols: OpenID, OAuth 1.0 and OAuth 2.0.

Maxim Zemskov 330 Jun 3, 2022
Laravel wrapper around OAuth 1 & OAuth 2 libraries.

Introduction Laravel Socialite provides an expressive, fluent interface to OAuth authentication with Facebook, Twitter, Google, LinkedIn, GitHub, GitL

The Laravel Framework 5.2k Dec 27, 2022
OAuth 1/2 Provider implementations for chillerlan/php-oauth-core. PHP 7.4+

chillerlan/php-oauth-providers Documentation See the wiki for advanced documentation. Requirements PHP 7.4+ a PSR-18 compatible HTTP client library of

chillerlan 4 Dec 2, 2022
Static utilitiy classes to bridge PSR-7 http messages to OAuth2 Server requests and responses.

Static utilitiy classes to bridge PSR-7 http messages to OAuth2 Server requests and responses. While this libray is entended for use with Slim 3, it should work with any PSR-7 compatible framework.

Chad Gray 18 Jul 12, 2021
A Laravel 5 package for OAuth Social Login/Register implementation using Laravel socialite and (optionally) AdminLTE Laravel package

laravel-social A Laravel 5 package for OAuth Social Login/Register implementation using Laravel socialite and (optionally) AdminLTE Laravel package. I

Sergi Tur Badenas 42 Nov 29, 2022
Social OAuth Authentication for Laravel 5. drivers: facebook, github, google, linkedin, weibo, qq, wechat and douban

Social OAuth Authentication for Laravel 5. drivers: facebook, github, google, linkedin, weibo, qq, wechat and douban

安正超 330 Nov 14, 2022
OAuth client integration for Symfony. Supports both OAuth1.0a and OAuth2.

HWIOAuthBundle The HWIOAuthBundle adds support for authenticating users via OAuth1.0a or OAuth2 in Symfony. Note: this bundle adds easy way to impleme

Hardware Info 2.2k Dec 30, 2022
Kaiju is an open source verification bot based on Discord's OAuth written in C# and PHP, with the functionality of being able to integrate the user to a new server in case yours is suspended.

What is Kaiju? Kaiju is an open source verification bot for Discord servers, based on OAuth and with permission for the server owner, to be able to mi

in the space 10 Nov 20, 2022
OAuth Service Provider for Laravel 4

OAuth wrapper for Laravel 4 oauth-4-laravel is a simple laravel 4 service provider (wrapper) for Lusitanian/PHPoAuthLib which provides oAuth support i

Dariusz Prząda 693 Sep 5, 2022
OAuth Service Provider for Laravel 5

OAuth wrapper for Laravel 5 oauth-5-laravel is a simple laravel 5 service provider (wrapper) for Lusitanian/PHPoAuthLib which provides oAuth support i

null 2 Sep 19, 2018
A spec compliant, secure by default PHP OAuth 2.0 Server

PHP OAuth 2.0 Server league/oauth2-server is a standards compliant implementation of an OAuth 2.0 authorization server written in PHP which makes work

The League of Extraordinary Packages 6.2k Jan 4, 2023
Easy integration with OAuth 2.0 service providers.

OAuth 2.0 Client This package provides a base for integrating with OAuth 2.0 service providers. The OAuth 2.0 login flow, seen commonly around the web

The League of Extraordinary Packages 3.4k Dec 31, 2022
PHP 5.3+ oAuth 1/2 Client Library

PHPoAuthLib NOTE: I'm looking for someone who could help to maintain this package alongside me, just because I don't have a ton of time to devote to i

David Desberg 1.1k Dec 27, 2022
OAuth 1 Client

OAuth 1.0 Client OAuth 1 Client is an OAuth RFC 5849 standards-compliant library for authenticating against OAuth 1 servers. It has built in support f

The League of Extraordinary Packages 907 Dec 16, 2022
The first PHP Library to support OAuth for Twitter's REST API.

THIS IS AN MODIFIED VERSION OF ABRAHAMS TWITTER OAUTH CLASS The directories are structured and the class uses PHP5.3 namespaces. Api.php has a new

Ruud Kamphuis 51 Feb 11, 2021
The most popular PHP library for use with the Twitter OAuth REST API.

TwitterOAuth The most popular PHP library for Twitter's OAuth REST API. See documentation at https://twitteroauth.com. PHP versions listed as "active

Abraham Williams 4.2k Dec 23, 2022
This module is intended to provide oauth authentication to freescout.

OAuth FreeScout This module is intended to provide oauth authentication to freescout. Module was tested on keycloak oauth provider with confidential o

Michael Bolsunovskyi 9 Dec 21, 2022
The Salla OAuth Client library is designed to provide client applications with secure delegated access to Salla Merchant stores.

Salla Provider for OAuth 2.0 Client This package provides Salla OAuth 2.0 support for the PHP League's OAuth 2.0 Client. To use this package, it will

Salla 14 Nov 27, 2022
Twitter OAuth API for PHP 5.3+

README The Wid'op OAuth library is a modern PHP 5.3+ API allowing you to easily obtain a Twitter access token. For now, it supports OAuth Web & Applic

Wid'op 8 Dec 11, 2020