Download the PHP package tadasei/laravel-keycloak-guard without Composer
On this page you can find all versions of the php package tadasei/laravel-keycloak-guard. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download tadasei/laravel-keycloak-guard
More information about tadasei/laravel-keycloak-guard
Files in tadasei/laravel-keycloak-guard
Package laravel-keycloak-guard
Short Description A Laravel authentication guard for Keycloak OAuth2 resource servers with token introspection and optional caching support.
License MIT
Homepage https://github.com/leandrose/laravel-keycloak-guard
Informations about the package laravel-keycloak-guard
Laravel Keycloak Guard
A lightweight Laravel authentication guard for applications acting as OAuth2 / OpenID Connect resource servers using Keycloak.
This package validates Bearer tokens issued by Keycloak by first verifying the JWT signature locally with the realm public key and then confirming the token through the token introspection endpoint.
It also provides optional caching of introspection responses to reduce load on the Keycloak server and improve API performance.
Features
- Stateless Bearer Token authentication
- Keycloak OAuth2 / OpenID Connect integration
- Token validation via local JWT verification plus introspection endpoint
- Optional introspection caching
- Cache TTL automatically respecting token expiration (
exp) - Custom Laravel Guard
- Works with Laravel 10, 11, 12 and 13
Requirements
- PHP 8.2+
- Laravel 10 / 11 / 12 / 13
- Keycloak server with OAuth2 / OpenID Connect enabled
- Keycloak realm public key available to the application
Version Compatibility
| Package Version | Laravel 10 | Laravel 11 | Laravel 12 | Laravel 13 |
|---|---|---|---|---|
v1.0 |
✅ | ✅ | ✅ | ✅ |
Installation
Install the package via Composer:
Publish the configuration file:
Add this to the guards array in config/auth.php:
Configure the Keycloak connection in your environment:
KEYCLOAK_REALM_PUBLIC_KEY can be provided either as a full PEM or as the raw base64 body of the public key.
All versions of laravel-keycloak-guard with dependencies
ext-json Version *
ext-openssl Version *
illuminate/auth Version ^10|^11|^12|^13
illuminate/cache Version ^10|^11|^12|^13
illuminate/contracts Version ^10|^11|^12|^13
illuminate/http Version ^10|^11|^12|^13
illuminate/support Version ^10|^11|^12|^13
guzzlehttp/guzzle Version ^6.5|^7
firebase/php-jwt Version ^6.3|^7