auth-middleware

Enforce PKCE, RBAC, and session policies for OAuth middleware.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/Vincri126/MCO-Template --skill auth-middleware
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: auth-middleware
Source: https://github.com/Vincri126/MCO-Template/tree/main/.orchestrator/skills/auth-middleware
Command: npx skills add https://github.com/Vincri126/MCO-Template --skill auth-middleware

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill codifies the authentication and authorization architecture needed to securely layer Google and Microsoft OAuth flows on top of Supabase, preventing misconfigurations and ensuring middleware can enforce RBAC, session policies, and QA gates without blind spots.

Core Features & Use Cases

  • Architecture guidance: Walks through Supabase vs custom auth decisions, PKCE enforcement, token refresh strategies, and how to align OAuth flows with Entra ID and Google Workspace APIs.
  • Implementation patterns: Includes middleware and Next.js protection examples, Graph and Workspace API integration helpers, and session management plus security header best practices.
  • Security QA: Ships with a bash QA gate that scans for hardcoded secrets, PKCE usage, CORS/cookie policies, audit logging, and Supabase RLS readiness before merging auth changes.

Quick Start

Ask auth-middleware to review your Google and Microsoft OAuth configuration, ensure Supabase middleware enforces PKCE and RBAC, and summarize the security guardrails before deployment.

Frequently Asked Questions about auth-middleware

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

FAQPage Schema
How do I enforce RBAC and PKCE in Next.js middleware with Supabase and OAuth?

To enforce RBAC and PKCE in Next.js middleware, you configure Supabase auth layers to validate session continuity and apply security gates before routing. This ensures token refresh monitoring and role-based access control across SPAs and backend services.

Does Supabase work with Google and Microsoft OAuth for production authentication?

Yes, Supabase works with Google and Microsoft OAuth for production authentication by layering Entra ID and Google Workspace APIs on top of its auth. This integration requires configuring PKCE enforcement and token refresh strategies to prevent misconfigurations.

What is the best way to secure OAuth session continuity across mobile clients and SPAs?

Securing OAuth session continuity across mobile clients and SPAs requires production-grade middleware that monitors token refresh cycles and enforces security headers. This approach prevents session hijacking and maintains access continuity across diverse client platforms.

How do I run a security QA gate for Supabase RLS and OAuth before merging?

You run a bash QA gate script that scans your codebase for hardcoded secrets, validates PKCE usage, checks CORS and cookie policies, and verifies Supabase RLS readiness. This documents architecture decisions and prevents blind spots before merging auth changes.

Why does my Microsoft Graph API integration fail with Supabase OAuth?

Microsoft Graph API integrations fail with Supabase OAuth when middleware lacks proper RBAC enforcement and token refresh monitoring. Aligning OAuth flows with Entra ID configurations and applying session policies resolves access and continuity issues.

Can I use auth-middleware for Node deployments without Next.js?

Yes, auth-middleware supports production-grade Node deployments alongside Next.js by applying OAuth security gates, RBAC enforcement, and session management. It handles PKCE enforcement and token monitoring across both environments.