setup-sso-subapp

Configures SSO for a sub-application using RS256 JWTs from the amsa_session cookie.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/Ascenseurs-Menetrey-SA/amsa-claude-skills --skill setup-sso-subapp
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: setup-sso-subapp
Source: https://github.com/Ascenseurs-Menetrey-SA/amsa-claude-skills/tree/main/setup-sso-subapp
Command: npx skills add https://github.com/Ascenseurs-Menetrey-SA/amsa-claude-skills --skill setup-sso-subapp

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you secure a sub-application on menetrey-lift.ch so it can authenticate users via the intranet SSO cookie (amsa_session) without implementing any login or OAuth flows inside the sub-app.

Core Features & Use Cases

  • SSO verification with JWKS (RS256): Validates JWTs using PyJWT’s PyJWKClient with proper issuer/audience checks and cache/rotation behavior.
  • Automatic local user provisioning: Creates and updates local users on first authenticated request using SSO claims (with fallbacks for missing name fields).
  • Production-ready infrastructure guidance: Configures backend fail-secure settings (e.g., docs disabled by default), frontend runtime configuration (window.RUNTIME_CONFIG), CORS with credentials, and Docker/Caddy routing for a new subdomain.
  • Safety guardrails for admin management: Prevents administrative lockout through zero-admin protections and blocks self-mutations that could disable the last admin.

Quick Start

Run the SSO setup by applying the Skill’s checklist to your target sub-app (backend JWT verification + user provisioning, frontend redirect on 401 with withCredentials, and Docker/Caddy/CORS configuration) so authentication is SSO-only and always active.

Frequently Asked Questions about setup-sso-subapp

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

FAQPage Schema
How do I validate RS256 JWTs from a shared cookie using FastAPI and PyJWKClient?

Validate RS256 JWTs from a shared cookie using FastAPI by configuring PyJWKClient to fetch public keys via JWKS, enforcing strict issuer, audience, and leeway checks, and caching keys for rotation to securely authenticate sub-app users.

How does cookie-based SSO authentication provision local users in a FastAPI backend?

Cookie-based SSO authentication provisions local users in a FastAPI backend by intercepting authenticated requests, extracting claims from the validated JWT, and automatically creating or updating local user records with fallbacks for missing name fields.

Do I need to configure CORS with credentials for a FastAPI sub-app using SSO cookie authentication?

Yes, you must configure CORS with allow_credentials enabled for a FastAPI sub-app using SSO cookie authentication. This allows the frontend to send the shared session cookie cross-origin alongside runtime URL injection for proper redirect handling on 401 responses.

What's the best way to route a new subdomain for a FastAPI app using Docker and Caddy?

Route a new subdomain for a FastAPI app using Docker and Caddy by configuring Caddy as a reverse proxy, injecting runtime configuration via window.__RUNTIME_CONFIG__, and disabling backend API docs by default to maintain fail-secure production defaults.

Why does FastAPI JWT verification fail when the JWKS issuer or audience does not match the token claims?

FastAPI JWT verification fails when JWKS issuer or audience checks reject mismatched token claims. Ensure PyJWKClient configuration explicitly matches the expected issuer and audience values, and apply leeway to handle minor clock skew between servers.

How do I prevent admin lockout when provisioning users from SSO claims in a sub-app?

Prevent admin lockout when provisioning users from SSO claims by implementing zero-admin protections that block self-mutations, ensuring an authenticated user cannot disable their own admin privileges or remove the last remaining administrator account.