Weave Code
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

Oauth2 Keycloak Laravel Package

stevenmaguire/oauth2-keycloak

Laravel-friendly OAuth2 client provider for Keycloak using theleague/oauth2-client. Handles Keycloak authorization, token retrieval/refresh, and user profile fetching so your app can authenticate via Keycloak with minimal setup.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Identity & Access Management (IAM) Integration: Enables seamless OAuth2-based authentication with Keycloak, reducing reliance on custom auth solutions and accelerating time-to-market for SSO (Single Sign-On) features.
  • Roadmap Prioritization: Justifies investment in Keycloak as an identity provider (IdP) over alternatives like Okta, Auth0, or custom solutions, especially for teams already using Keycloak or evaluating it for compliance/self-hosting needs.
  • Build vs. Buy: Eliminates the need to build a custom OAuth2 provider for Keycloak, reducing technical debt and maintenance overhead. Aligns with "buy" decisions for standardized, community-supported libraries.
  • Use Cases:
    • B2B/B2C Platforms: Secure multi-tenant access with Keycloak’s role-based policies.
    • Compliance-Driven Projects: Self-hosted Keycloak meets GDPR, HIPAA, or SOC2 requirements.
    • Legacy System Modernization: Integrate OAuth2 into older PHP/Laravel apps without full auth overhauls.
    • Microservices: Centralized auth for Laravel-based APIs/services using Keycloak as a gateway.

When to Consider This Package

Adopt if:

  • Your stack includes Laravel + PHP and you need OAuth2/OIDC support for Keycloak.
  • Keycloak is your preferred IdP (self-hosted, open-source, or enterprise-grade).
  • You require minimal setup for standard OAuth2 flows (authorization code, PKCE, etc.) without reinventing the wheel.
  • Your team lacks deep OAuth2 expertise but needs production-ready integration.

Look elsewhere if:

  • You’re using non-Keycloak IdPs (e.g., Auth0, Okta, Azure AD) → Use their official Laravel packages.
  • You need advanced Keycloak features (e.g., custom protocols, dynamic client registration) → Consider a dedicated Keycloak SDK or extension.
  • Your project is JavaScript/TypeScript-heavy → Use keycloak-js or passport-keycloak (Node.js).
  • You require real-time auth events (e.g., WebSockets) → Evaluate Keycloak’s native adapters or event listeners.
  • License concerns: MIT is permissive, but ensure compliance with Keycloak’s own licensing if self-hosting.

How to Pitch It (Stakeholders)

For Executives: "This package lets us integrate Keycloak—our chosen identity provider—into our Laravel apps with minimal effort. It’s like plugging in a pre-built adapter for OAuth2, saving months of dev time while ensuring security and compliance. Keycloak’s self-hosted flexibility aligns with our [cost/scalability/compliance goals], and this package reduces risk by leveraging a battle-tested, community-supported solution. Upfront cost: zero; ROI: faster feature delivery and lower maintenance."

For Engineering: *"The stevenmaguire/oauth2-keycloak package is a lightweight Laravel wrapper for Keycloak’s OAuth2 provider. It handles:

  • Standard flows (authorization code, PKCE) out of the box.
  • Token validation and user info retrieval with minimal config.
  • Compatibility with Laravel’s Passport or Sanctum for session management. Key benefits: ✅ No custom OAuth2 logic—just configure your Keycloak client ID/secret. ✅ Active maintenance (recent 2026 release) with 227+ stars. ✅ MIT license—no legal blockers. Trade-offs: ⚠️ Limited to Keycloak (not multi-IdP). ⚠️ May need customization for niche Keycloak features. Recommendation: Pilot in a non-critical module to validate integration speed and stability before full adoption."*
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.
nexmo/api-specification
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
ecotone/kafka
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata