acsystems/keycloak-guard-bundle
Laravel guard/authentication bundle for integrating Keycloak. Adds a custom auth guard, handles token validation and user resolution from Keycloak, and supports protecting routes with Keycloak-backed authentication for API or web apps.
security.yaml and Guard authenticators, requiring minimal configuration.jwks-php integration).UserProvider or UserLoader may be needed.main auth provider in security.yaml with keycloak_guard.keycloak_guard.yaml with realm, client ID, and audience.User entity to map JWT claims (e.g., username, email).UserProvider if custom logic is needed (e.g., role mapping).Authenticator).security.yaml ordering.security.yaml before writing custom logic.ON_AUTHENTICATION_FAILURE events.jwks-php caching.| Failure | Impact | Mitigation |
|---|---|---|
| Keycloak downtime | Auth failures | Local auth fallback or circuit breaker. |
| JWT validation errors | 401/500 responses | Retry logic or user-friendly messages. |
| Key rotation | Broken sessions | Cache JWKS with TTL < Keycloak’s key lifespan. |
| Token leakage | Security risk | Short-lived tokens, PKCE for SPAs. |
security.yaml and test basic flows.How can I help you explore Laravel packages today?