New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

ceedcv-maya/shared-auth-laravel

Keycloak/OIDC JWT authentication middleware for Laravel: JWKS caching, RequirePermissionMiddleware, AppToAppAuthenticator, configurable user resolver.
1,046

Larablocks Analysis

ceedcv-maya/shared-auth-laravel works with Laravel 11, 12 and 13 (latest release v0.23.0, Oct 14, 2026).

Promising: maintained and up to date, meets 2 of 4 checks; not yet widely used.

  • Works with Laravel 13, the current version
  • Released in the last 12 months (Oct 14, 2026)
  • 37 downloads a month (needs 10,000)
  • 0 GitHub stars (needs 100)

State

Actively maintained
  • Last stable release: Oct 14, 2026.
  • 32 releases in the last 12 months.
  • First released: May 25, 2026.
  • Monthly downloads: 37.
  • 0 open issues on GitHub.

Data from Packagist and GitHub, checked by Larablocks on Nov 28, 2026.

Install
composer require ceedcv-maya/shared-auth-laravel
Latest Version:v0.23.0
PHP:^8.4
Laravel:11 · 12 · 13
License:MIT
Last Updated:Oct 15, 2026
Links: GitHub  ·  Packagist
Maintainer: GGEdu

ceedcv-maya/shared-auth-laravel

Keycloak/OIDC JWT authentication middleware for Laravel: JWKS caching, RequirePermissionMiddleware, AppToAppAuthenticator, configurable user resolver.

Part of the ceedcv-maya/maya_platform mono-repo. Distributed independently for reuse outside the Maya ecosystem.

Installation

composer require ceedcv-maya/shared-auth-laravel
// routes/api.php
use Maya\Auth\Middleware\AuthenticateJwt;
use Maya\Auth\Middleware\RequirePermission;

Route::middleware([AuthenticateJwt::class, RequirePermission::class.':users.read'])->group(function () {
    Route::get('/me', fn () => auth()->user());
});
KEYCLOAK_URL=https://keycloak.example.org
KEYCLOAK_REALM=my-realm
KEYCLOAK_CLIENT_ID=my-app

Token validation (JwtMiddleware)

A request passes only with a Keycloak access token that meets all of these:

Check Rule Config
Signature RS256 with the JWKS key named by the kid header (JWKS cached) auth.jwks_url, auth.jwks_cache_ttl
Issuer iss equals the configured issuer auth.jwt_issuer
Expiry exp is required and must be in the future (also iat/nbf when present); no clock leeway —
Token type typ claim is exactly Bearer (Keycloak access token). ID tokens (ID), refresh tokens (Refresh, Offline) and tokens without typ are rejected —
Audience aud contains, or azp equals, one of the comma-separated values (one per app: its own client_id) auth.jwt_audience (required outside testing)

Any failure returns 401 (WWW-Authenticate: Bearer error="invalid_token") and logs JWT authentication failed: info with error_code=JWT-EXPIRED for expired tokens, warning with error_code=JWT-INVALID for everything else.

Tests that mint their own JWTs (instead of bypassing the middleware) must add the typ: Bearer and exp claims.

TypeScript / build notes

PSR-4 autoload from src/. Service providers are registered via Laravel package discovery (no manual provider registration needed).

License

MIT — see LICENSE.

Reporting issues

The canonical source lives in Maya-AQSS/maya_platform. File issues there; this read-only split repo is only the published artifact.

Alternatives to ceedcv-maya/shared-auth-laravel

tymon/jwt-auth

JSON Web Token Authentication for Laravel and Lumen

57,581,572 11,470
php-open-source-saver/jwt-auth

JSON Web Token Authentication for Laravel and Lumen

14,304,794 845
ejarnutowski/laravel-api-key

Authorize requests to your Laravel application with API keys

511,580 157
aymakan/laravel-mfa

API-only Multi-Factor Authentication enforcement for Laravel (TOTP, middleware-d...

2,300 0
fidelize/jwt-auth-multiple-keys

Add multiple keychain support to tymon/jwt-auth package

17,038 0

Version History

Version Released PHP Laravel License
v0.23.0 ^8.4 ^11.0 || ^12.0 || ^13.0 MIT
v0.22.2 ^8.4 ^11.0 || ^12.0 || ^13.0 MIT
v0.22.1 ^8.4 ^11.0 || ^12.0 || ^13.0 MIT
v0.22.0 ^8.4 ^11.0 || ^12.0 || ^13.0 MIT
v0.21.0 ^8.4 ^11.0 || ^12.0 || ^13.0 MIT