implementing-scalekit-laravel-auth

Integrate Scalekit OAuth authentication into Laravel apps with middleware.

Updated Feb 9, 2026
One-click install
npx skills add https://github.com/scalekit-inc/claude-code-authstack --skill implementing-scalekit-laravel-auth
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: implementing-scalekit-laravel-auth
Source: https://github.com/scalekit-inc/claude-code-authstack/tree/main/plugins/full-stack-auth/skills/implementing-scalekit-laravel-auth
Command: npx skills add https://github.com/scalekit-inc/claude-code-authstack --skill implementing-scalekit-laravel-auth

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Laravel applications often struggle to add scalable authentication with OAuth, session storage, token refresh, and per-route permissions without duplicating code. Scalekit provides a unified OAuth flow, but integrating it with Laravel requires explicit wiring of login, callback handling, middleware, and config-driven environment variables.

Core Features & Use Cases

  • Login integration with Scalekit OAuth
  • Callback processing and token management
  • Laravel session storage for auth state and tokens
  • Automatic token refresh via middleware
  • Logout flow and post-logout redirection
  • Per-route permission checks and gated routes
  • Use Case: Secure admin dashboards and agent endpoints with granular permissions

Quick Start

Install the package, configure SCALEKIT_* environment variables, and register the provided controllers, middleware, and routes in your Laravel app.

Frequently Asked Questions about implementing-scalekit-laravel-auth

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement OAuth authentication in Laravel with Scalekit?

OAuth login in Laravel with Scalekit works by redirecting users to the Scalekit authorization endpoint and processing the callback to establish a session. You register dedicated controllers and configure SCALEKIT environment variables to handle the token exchange and persist auth state securely.

How does Laravel middleware handle automatic token refresh for Scalekit sessions?

Laravel middleware handles automatic token refresh by intercepting requests and validating the stored Scalekit OAuth tokens. If a token is expired, the middleware refreshes it transparently, ensuring secure session management without interrupting the user's request flow.

Can I set up per-route permission checks in Laravel using Scalekit?

Yes, you can set up per-route permission checks in Laravel using Scalekit. The provided middleware allows you to gate specific routes by enforcing granular permissions, ensuring only authorized users access secure admin dashboards and protected agent endpoints.

What is the best way to configure environment variables for Scalekit OAuth in a Laravel application?

The best way to configure Scalekit OAuth environment variables in Laravel is by defining SCALEKIT_* entries in your environment configuration. This config-driven approach ensures the authentication client securely connects across different deployment environments without hardcoding sensitive credentials.

Does Scalekit handle secure logout and post-logout redirection in Laravel?

Scalekit handles secure logout and post-logout redirection in Laravel by clearing the local session state and revoking the OAuth token. You configure the post-logout redirect destination to safely return users to a designated public landing page or login screen.