Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Keycloak Laravel Package

socialiteproviders/keycloak

Keycloak OAuth2 provider for Laravel Socialite. Adds a Keycloak driver so your app can authenticate users through a self-hosted or cloud Keycloak realm, handling the OAuth redirect, callback, and user retrieval with Socialite's familiar API.

Deep Wiki
Context7

Technical Evaluation

Architecture fit. socialiteproviders/keycloak is a thin OAuth2 driver that plugs Keycloak into Laravel Socialite via the socialiteproviders/manager extension mechanism. It is not a full Keycloak integration: it covers the authorization-code login flow and basic user retrieval, but does not provide role/group mapping, admin API access, token refresh orchestration, back-channel or RP-initiated logout, or SAML. It fits cleanly if the product requirement is "let users sign in with our Keycloak IdP from a Laravel app" and the app already treats Socialite as its identity abstraction. It is a poor fit if Keycloak is expected to be the source of authorization decisions (roles, groups, fine-grained permissions) inside the app.

Integration feasibility. Low effort. The package is installed via Composer, registered through a service provider plus a SocialiteWasCalled event listener, and configured through config/services.php (client_id, client_secret, redirect, base_url, realms). A developer familiar with Socialite can complete a working login in a few hours against a test realm. The main configuration nuance is matching base_url/realm paths to the Keycloak distribution in use (legacy WildFly-style paths vs. the Quarkus distribution introduced with Keycloak 17+), plus correct redirect URI registration in the Keycloak client.

Technical risk. Moderate to high for anything mission-critical. The signals are weak: 22 stars, a 0.5 score, a last release of April 2023, and an "unknown" repository because this is a read-only subtree split of SocialiteProviders/Providers. That means issues and PRs do not live here, maintenance is centralized in a large monorepo, and the package's release cadence is tied to that project rather than to Keycloak or Laravel. Specific risks: unverified compatibility with current Laravel/Socialite majors (Laravel 11/12, Socialite 5.x+), no evident security-response process, single-maintainer/bus-factor exposure, and behavioral drift if Keycloak changes token or endpoint semantics. The code surface is small enough that forking or reimplementing in-house is realistic, which materially reduces the strategic risk but not the day-to-day maintenance risk.

Key questions.

  • Which Laravel, PHP, and Socialite versions are actually supported and tested, versus merely installable?
  • Which Keycloak versions and distributions (legacy vs. Quarkus) have been validated, and does the base_url/realms config model match our deployment?
  • Do we need roles, groups, or claims beyond basic profile — and if so, who owns that mapping?
  • Do we need RP-initiated logout, token refresh, or back-channel logout, none of which this provider handles?
  • Is PKCE or a public client required, and does the provider support it?
  • What is our exit plan if the upstream package stalls — fork, pin, or replace with an in-house Socialite provider?

Integration Approach

Stack fit. Best suited to a Laravel application already using Socialite for one or more providers, where Keycloak is one additional identity source. The package expects the standard Socialite contract: a service provider, an event listener registered in EventServiceProvider, and a services.keycloak config block. Applications using raw OAuth clients, SAML, or a custom auth guard will get less value and should weigh a direct OAuth2 client instead.

Migration path. If Socialite is already in place, this is additive: install the package, register the provider and listener, add config, wire routes for redirect and callback, and map the returned Socialite user to the local user model. If the app currently authenticates against Keycloak via a custom OAuth implementation or SAML, migrate behind a feature flag and run both paths in parallel until claim mapping and user provisioning are proven. If the app has no Socialite usage, adopt Socialite first as a separate decision — do not let this package force that architecture.

Compatibility. Treat compatibility as unproven until tested. Pin the package version in composer.json, verify the installed Socialite major, and confirm the Keycloak realm's endpoint paths. Validate PHP version constraints. Because the last release predates recent Laravel majors, assume a compatibility spike is required and budget for a small patch or a local fork if the upstream constraint blocks installation. Also verify TLS trust, redirect URI exact-match behavior, and whether the Keycloak client is confidential or public.

Sequencing.

  1. Stand up a non-production Keycloak realm and client with a dedicated redirect URI.
  2. Spike the package in a scratch Laravel branch: install, configure, complete login, inspect the returned user payload and raw claims.
  3. Decide claim-to-user mapping and provisioning rules (JIT creation vs. pre-provisioned accounts).
  4. Add role/group handling in application code by reading token claims, since the provider will not do this for you.
  5. Implement logout semantics explicitly — local session invalidation at minimum, Keycloak RP-initiated logout if required.
  6. Roll out behind a feature flag with local auth as fallback, then remove the flag after a stabilization window.

Operational Impact

Maintenance. Low ongoing code maintenance but non-trivial dependency maintenance. The package is stable because it does little, but it is also stale. Ownership should sit with the platform/auth team, with a recurring quarterly check on upstream releases, Socialite major upgrades, and Keycloak version changes. Because this repo is a read-only split, issue triage and patching must target SocialiteProviders/Providers; plan for the possibility that fixes are not merged on our timeline and that we carry a fork.

Support. Community-only, no SLA, no vendor. Internal runbooks and an internal owner are mandatory. Escalation path is: check upstream monorepo issues, inspect the provider source (small enough to read end-to-end), patch locally or fork.

Scaling. The authorization-code flow is stateless at the provider level and scales with the Laravel app; Keycloak bears identity load. Real scaling concerns sit outside this package: session storage, token/claim caching, Keycloak realm and database sizing, and connection pooling to Keycloak. The provider adds negligible overhead.

Failure modes.

  • Keycloak unavailable or realm misconfigured → login fails; local auth fallback should exist for admins.
  • base_url/realm path mismatch after a Keycloak upgrade → callback or token exchange errors.
  • Redirect URI mismatch or client secret rotation → immediate auth outage; needs config-as-code and rotation runbook.
  • Socialite or Laravel upgrade breaking the provider contract → install-time or runtime failure; caught only by an integration test against a real realm.
  • Claim shape changes in Keycloak mappers → user provisioning or role mapping silently wrong; validate claims in tests.
  • No logout propagation → stale sessions after IdP-side revocation; must be addressed in application code.
  • TLS/certificate issues between app and Keycloak → intermittent auth failures that look like user error.

Ramp-up. Small for a Laravel developer: hours to first working login, one to two days to production-grade with tests, claim mapping, logout, and fallback. The larger ramp-up is Keycloak-side configuration and operational familiarity (realms, clients, mappers, token lifetimes), which should be owned by whoever operates the IdP. Given the low star count and stale release, onboard with the explicit expectation that the team owns the code path, not the upstream maintainers.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
abbasudo/artisan-route
mirvan/ippanel
ignibyte/aic-framework
glavweb/data-schema-bundle
glavweb/datagrid-bundle
tacticmedia/scim-server
uni-method/frame
neika-ai/sdk
adachsoft/php-code-style
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
adachsoft/api-version-bundle
cgv/localized-resource
noith/settings
kda/laravel-package