Download the PHP package jhnbrn90/socialite-passport without Composer
On this page you can find all versions of the php package jhnbrn90/socialite-passport. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jhnbrn90/socialite-passport
More information about jhnbrn90/socialite-passport
Files in jhnbrn90/socialite-passport
Package socialite-passport
Short Description Easy socialite authentication using Laravel passport identity provider.
License MIT
Homepage https://github.com/jhnbrn90/socialite-passport
Informations about the package socialite-passport
Socialite Passport
This package provides an easy way to authenticate users via a central identity provider that uses Laravel Passport.
In other words, allow users to login to "client" apps app1.example.com
and app2.example.com
using their account on auth.example.com
(which uses Laravel passport).
This package is aimed at simplifying the socialite integration in the "client" app, and assumes an existing "ID provider" set-up with Laravel Passport.
Generalized workflow:
- Create new
OAuth Client
in the "ID provider" - Configure the
keys
,redirect url
andhost
in the.env
file of the "client" - Configure which
Controller
should be passed the authenticated OAuth$user
object in the client - Register or log in the
$user
in the "client".
For more details, see the Installation
and Usage
sections below.
Installation
You can install the package via composer:
Publish the configuration
`
Configure the controller and method which should handle the authenticated user. Furthermore, you can customize the route and route name which should be used to log in users.
Next, the following environment variables should be added to .env
, where CLIENT_ID
and CLIENT_SECRET
are obtained from the Laravel Passport identity provider.
The REDIRECT_URI
variable will automatically map the correct callback route in the routes file. Therefore, this can be anything you'd like (convention is to use login/[name-of-service]/callback
.
Usage
The example configuration (above) assumes you have added a loginWithPassport()
method to the default LoginController
.
This method will get the $user
object injected (see https://socialiteproviders.netlify.com/providers/laravel-passport.html).
Example of the OAuth2\User
object $user
(as JSON):
Changelog
Please see CHANGELOG for more information what has changed recently.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
- John Braun
- All Contributors
All versions of socialite-passport with dependencies
illuminate/support Version ~6|~7
socialiteproviders/laravelpassport Version ^1.0
laravel/socialite Version ^4.3