Download the PHP package mjollnir/oidconnect-laravel without Composer
On this page you can find all versions of the php package mjollnir/oidconnect-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mjollnir/oidconnect-laravel
More information about mjollnir/oidconnect-laravel
Files in mjollnir/oidconnect-laravel
Package oidconnect-laravel
Short Description OpenID Connect client library for Laravel Framework
License MIT
Informations about the package oidconnect-laravel
The OpenIDConnect Laravel package is meant to provide you an opportunity to easily authenticate users using OpenID Connect protocol.
Installation
To install this package you will need:
- Laravel 5.5+
- PHP 7.1+
Use composer to install
Open config/app.php
and register the required service providers above your application providers.
If you'd like to make configuration changes in the configuration file you can pubish it with the following Aritsan command:
After that, roll up migrations:
Usage
Configuration
At first you will need to add credentials for the OpenID Connect service your application utilizes.
These credentials should be placed in your config/opidconnect.php
configuration file.
Endpoints
Now, your app has auth endpoints:
GET /auth/redirect
- Used to redirect client to Auth Service login page.GET /auth/callback
- Used when Auth Service redirect client to callback url with code.POST /auth/refresh
- Used by client for ID Token refreshing.
Middleware
You need to use Auth Middleware on protected routes.
Open App\Http\Kernel
and register middleware in $routeMiddleware
:
And then use it as usual:
User Auth
Create your own StatelessGuard
and setup it in config/auth.php
. Example:
Guard:
Config (config/auth.php
):
Then implement own Authenticator
. Example:
And implement auth guard service provider. Example:
Then register it in config/app.php
:
Now you can use \Auth::user();
for getting current user information.
All versions of oidconnect-laravel with dependencies
lcobucci/jose-parsing Version ~2.1
lcobucci/jwt Version ^3.2
illuminate/database Version ^5.5
illuminate/routing Version ^5.5