passport-development

Configure OAuth2 authentication for Laravel apps using Passport tokens.

Updated Apr 7, 2026
One-click install
npx skills add https://github.com/Sivanwol/sabo-platfom --skill passport-development-sivanwol
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: passport-development
Source: https://github.com/Sivanwol/sabo-platfom/tree/main/.agents/skills/passport-development
Command: npx skills add https://github.com/Sivanwol/sabo-platfom --skill passport-development-sivanwol

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Laravel apps often require secure and scalable API authentication. Passport provides a robust OAuth2 server integration, covering installations, grants, client management, route protection, scopes, and SPA cookie authentication, so developers can focus on building features rather than auth boilerplate.

Core Features & Use Cases

  • Install and configure Passport quickly for OAuth2-based authentication.
  • Define and manage OAuth2 grants (Authorization Code, Client Credentials, Personal Access Tokens, Device Authorization).
  • Protect API routes with access tokens, enforce scopes, and configure SPA cookie-based authentication.
  • Real-world use: secure an API consumed by a SPA and third-party clients with proper token lifetimes and refresh tokens.

Quick Start

Install Passport, configure the User model with HasApiTokens, set up the api guard, and create a client to start issuing tokens.

Frequently Asked Questions about passport-development

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

FAQPage Schema
How do I set up OAuth2 API authentication in Laravel using Passport?

To set up Laravel Passport OAuth2 API authentication, install the Passport package, integrate the HasApiTokens trait into your User model, configure the api guard, and generate encryption keys to start issuing access tokens.

What OAuth2 grant types does Laravel Passport support for API tokens?

Laravel Passport supports Authorization Code, Client Credentials, Personal Access Tokens, and Device Authorization grants, allowing you to issue API tokens tailored for SPAs, third-party clients, and machine-to-machine services.

How do I protect Laravel API routes with OAuth2 scopes and access tokens?

Protect Laravel API routes by validating access tokens via the api guard and enforcing OAuth2 scopes to restrict client permissions, ensuring secure token-based access for specific endpoints.

Can I use Laravel Passport for SPA cookie authentication instead of tokens?

Yes, Laravel Passport supports SPA cookie authentication, enabling your single-page application to consume your API securely using cookie-based sessions alongside standard OAuth2 token flows.

Do I need to configure token lifetimes and refresh tokens with Laravel Passport?

Configuring token lifetimes and refresh tokens in Laravel Passport is necessary to maintain secure, long-term API access, balancing user convenience with token expiration security for your application.

When should I use Laravel Passport over other API authentication methods?

Use Laravel Passport when you need a full OAuth2 server for third-party client management, complex grant types, and machine-to-machine API authentication, rather than simpler token-based solutions like Sanctum.