Download the PHP package 1-0-0-1/laravel-keycloak-extended-guard without Composer
On this page you can find all versions of the php package 1-0-0-1/laravel-keycloak-extended-guard. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download 1-0-0-1/laravel-keycloak-extended-guard
More information about 1-0-0-1/laravel-keycloak-extended-guard
Files in 1-0-0-1/laravel-keycloak-extended-guard
Package laravel-keycloak-extended-guard
Short Description Keycloak Guard for Laravel with remote validation
License proprietary
Homepage https://github.com/1-0-0-1/laravel-keycloak-extended-guard
Informations about the package laravel-keycloak-extended-guard
Keycloak Extended Guard for Laravel
This package helps you authenticate users on a Laravel API based on JWT tokens generated from Keycloak Server with remote checks.
Install
Require the package
Configuration
Laravel Auth
Changes on config/auth.php
Laravel Routes
Just protect some endpoints on routes/api.php
and you are done!
Keycloak Guard
The Keycloak Extended Guard configuration can be handled from Laravel .env
file. Be sure all strings are trimmed.
Optionally you can publish the config file.
client_secret
Required.
The Keycloak Server realm public key (string).
How to get realm public key? Click on "Realm Settings" > "Keys" > "Algorithm RS256" Line > "Public Key" Button
load_user
Required. Default is false
.
If you do not have an users
table you must disable this.
It fetchs user from database and fill values into authenticated user object. If enabled, it will work together with user_provider_credential
and token_principal_attribute
.
user_provider_credential
Required. Default is username
.
The field from "users" table that contains the user unique identifier (eg. username, email, nickname). This will be confronted against token_principal_attribute
attribute, while authenticating.
token_principal_attribute
Required. Default is preferred_username
.
The property from JWT token that contains the user identifier.
This will be confronted against user_provider_credential
attribute, while authenticating.
required_server_confirm
Required. Default is false
.
Allow token validation on keycloak server
base_url
Optional
Keycloak server URL
realm
Optional
Keycloak realm name