x96/socialite-passport

Easy socialite authentication using Laravel passport identity provider.

dev-main 2022-07-04 08:08 UTC

This package is not auto-updated.

Last update: 2024-04-22 17:15:45 UTC


README

This package provides an easy way to authenticate users via a central identity provider that uses Laravel Passport.

Installation

You can install the package via composer:

composer require x96/socialite-passport

Publish the configuration

php artisan vendor:publish --provider="x96\SocialitePassport\SocialitePassportServiceProvider" --tag="config"

Run migration

php artisan migrate

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.

LARAVELPASSPORT_CLIENT_ID=
LARAVELPASSPORT_CLIENT_SECRET=
LARAVELPASSPORT_REDIRECT_URI=/callback
LARAVELPASSPORT_HOST=https://auth.example.com

Usage