Download the PHP package uisits/laravel-oidc without Composer
On this page you can find all versions of the php package uisits/laravel-oidc. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-oidc
Laravel Shibboleth
This package extends the Laravel's first-party package socialite to authenticate and authorize using Shibboleth.
Usage:
-
Install the package:
-
Optional: Add Service provider to
config/app.php
file. -
Important: Install the package:
- Set environment variables in .env file (Check the
config/shibboleth.php
file)
Migrate database
Run php artisan migrate
Note:
For Authorization set
APP_AD_AUTHORIZE_GROUP
in the .env file.You can check user is admin using gates or directly using user model. ex:
Using SAML authentication
- Set the SAML environment variables
- Set the type property in
config/shibboleth.php
to saml
Using OIDC authentication
- Set the OIDC environment variables
- Set the type property in
config/shibboleth.php
to oidc
Set up authentication routes
set the authentication routes in routes/web.php
files
Authorization
- Define the ad group name in the .env file
- You can configure the redirect route to use after successfully authentication by overriding the
redirect_to
property in theconfig/shibboleth.php
file. - Set up the name of the group in
config/shibboleth.php
file under theauthorization
property'authorization' => env('APP_AD_AUTHORIZE_GROUP', null)
-
Add the trait
HasRoles
to theUsers
model - In your
app/AuthServiceProvider.php
file you can now assign Gates or check if user is admin anywhere in the application using the below logic:
You can extend the roles and permissions functionality to add new roles or permissions using Spatie Permission package
Token Introspection
For token introspection using OIDC add the following middleware to the app/Http/Kernel.php
file:
Under alias
property:
Now you can use the middleware on your protected route as such:
Note: Below is the response received when you get a user from token
Code Style
You can use Laravel pint to automatically fix code styles.
Testing
You can run the tests for the package using pest.
Issues and Concerns
Please open an issue on the GitHub repository with detailed description and logs (if available).
In case of security concerns please write an email to UIS ITS ADDS Team.
All versions of laravel-oidc with dependencies
illuminate/filesystem Version ^9.0|^10.0|^11.0
laravel/socialite Version ^5.10