Integrate Platform Auth

Integrate platform-auth authentication into Next.js apps with SSO proxy routes.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/stellarone/evaluate --skill integrate-platform-auth
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Integrate Platform Auth
Source: https://github.com/stellarone/evaluate/tree/main/.agents/skills/integrate-platform-auth
Command: npx skills add https://github.com/stellarone/evaluate --skill integrate-platform-auth

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill solves the problem of integrating platform-auth login and session handling into a Next.js consumer app without breaking SSO across *.stellarone.ai.

Core Features & Use Cases

  • Environment setup: Adds the required Supabase and PLATFORM_AUTH_URL variables to ensure the app can validate sessions and talk to the platform-auth service.
  • Session and auth wiring: Guides copying the browser and server Supabase clients plus server-side session/user helpers and server auth guards for protected routes.
  • API proxy routes: Provides thin Next.js proxy endpoints for the platform-auth flows (login, logout, signup, OTP verification, password resets, invite/bootstrap, and signup validation) to keep auth traffic consistent and centralized.
  • Cross-subdomain SSO cookies: Configures cookie options (domain, path, sameSite, secure) so sessions persist across all apps under *.stellarone.ai.
  • Use Case: You want to enable org-based sign-in for a new Next.js app so authenticated users land in protected areas automatically, while unauthenticated users get redirected to /auth.

Quick Start

Ask to integrate Platform Auth by setting PLATFORM_AUTH_URL and copying the listed Supabase session files and auth proxy routes, then protect your app layout using withOrgAuth.

Frequently Asked Questions about Integrate Platform Auth

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

FAQPage Schema
How do I add cross-subdomain SSO authentication to a Next.js app?

Cross-subdomain SSO is added by configuring session cookie options (domain, path, sameSite, secure) and implementing Next.js API proxy routes for login, logout, and signup flows. This ensures authenticated sessions persist seamlessly across all apps on *.stellarone.ai.

How does platform-auth handle protected routes in Next.js?

Protected routes are handled by applying server-side auth guards to your Next.js app layout. The auth guard checks the Supabase session user and automatically redirects unauthenticated requests to the /auth page, keeping protected areas secure.

What environment variables do I need to set up Supabase auth proxy routes?

Setting up Supabase auth proxy routes requires adding Supabase environment variables and PLATFORM_AUTH_URL to your Next.js app. These variables enable the app to validate sessions and forward Authorization headers to the platform-auth service.

Can I proxy OTP verification and password reset flows through Next.js server routes?

Yes, OTP verification and password reset flows can be proxied through thin Next.js server routes. These proxy endpoints forward Authorization headers to the platform-auth service, keeping all authentication traffic centralized and consistent across your app.

Why do my Supabase session cookies break when navigating between subdomains?

Supabase session cookies break across subdomains when the cookie domain option is not explicitly set. Configuring the cookie domain options for *.stellarone.ai ensures the session token is shared and persists across all connected subapps.

Does this SSO integration work without modifying the existing Next.js app layout?

No, SSO integration requires modifying the Next.js app layout by wrapping it with the withOrgAuth auth guard. This module enforces session validation and redirects unauthenticated users to /auth, ensuring protected routes are secured.