saas-auth

saas-auth is a skill for Claude Code from TheWayWithin/agent-11. It costs 3 tokens per session (4,279 once invoked), scanned A, original, MIT.

An authentication guide for SaaS applications, which are online software products used by many customers. It covers account creation, email or social sign-in, sessions, password recovery, rate limits, and multi-factor authentication.

In plain words
What is it for?
Use it to implement registration with email verification, password or social login, password reset, session and token handling, rate limiting, and multi-factor authentication.
Why use it?
It removes the need to design the complete sign-in and account-recovery lifecycle from scratch. It also addresses common risks such as brute-force login attempts and unsafe password handling.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/thewaywithin/agent-11/saas-auth
Any agent
npx skills add TheWayWithin/agent-11 --skill saas-auth
Clone the repo
git clone --depth 1 https://github.com/TheWayWithin/agent-11

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for saas-auth

README.md
[![agentmods](https://agentmods.dev/badge/skills/thewaywithin/agent-11/saas-auth.svg)](https://agentmods.dev/skills/thewaywithin/agent-11/saas-auth)
Your own site
<a href="https://agentmods.dev/skills/thewaywithin/agent-11/saas-auth"><img src="https://agentmods.dev/badge/skills/thewaywithin/agent-11/saas-auth.svg" alt="Measured on agentmods" height="20"></a>
Per session 3 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,279 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00003 $0.04279
Opus 5 $0.00002 $0.02139
Sonnet 5 $0.00001 $0.00856
Haiku 4.5 $0.00000 $0.00428

Measured yesterday against content hash 8ce4480bb481, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

saas-auth scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/saas-auth/SKILL.md · 644 lines

How it starts

The opening of the file, as written. The whole thing — 644 lines — stays where its author put it; the contents beside it link to each section on GitHub.

SaaS Authentication

Capability

Implement production-ready authentication for SaaS applications including email/password, OAuth social login, session management, and security best practices. This skill covers the complete auth lifecycle from signup through password recovery.

Use Cases

  • User registration with email verification
  • Login with email/password or social providers
  • Password reset and recovery flows
  • Session management and token handling
  • Rate limiting and brute force protection
  • Multi-factor authentication setup

Patterns

Email/Password Authentication

When to use: Standard SaaS signup/login flow with email verification

Implementation: Create registration endpoint that hashes password, stores user, sends verification email. Login validates credentials and creates session.

// Registration flow
async function register(email: string, password: string) {
  // 1. Validate email format and password strength
  validateEmail(email);
  validatePasswordStrength(password); // min 8 chars, mixed case, number

  // 2. Check if user exists
  const existing = await findUserByEmail(email);
  if (existing) throw new Error('Email already registered');

  // 3. Hash password with bcrypt (cost factor 12)
  const passwordHash = await bcrypt.hash(password, 12);

  // 4. Create user with unverified status
  const user = await createUser({
    email,
    passwordHash,
    emailVerified: false,
    createdAt: new Date()
  });

  // 5. Generate verification token (expires in 24h)
  const token = generateSecureToken();
  await storeVerificationToken(user.id, token, 24 * 60 * 60);

  // 6. Send verification email
  await sendVerificationEmail(email, token);

  return { success: true, message: 'Check email for verification link' };
}

OAuth/Social Login

When to use: Allow users to sign in with Google, GitHub, or other OAuth providers

Implementation: Configure OAuth provider, handle callback, link or create account.

// OAuth callback handler
async function handleOAuthCallback(provider: string, code: string) {
  // 1. Exchange code for tokens
  const tokens = await exchangeCodeForTokens(provider, code);

  // 2. Get user profile from provider
  const profile = await getOAuthProfile(provider, tokens.access_token);

  // 3. Find or create user
  let user = await findUserByOAuthId(provider, profile.id);

  if (!user) {
    // Check if email exists (account linking)
    user = await findUserByEmail(profile.email);
    if (user) {
      // Link OAuth to existing account
      await linkOAuthAccount(user.id, provider, profile.id);
    } else {
      // Create new user
      user = await createUser({
        email: profile.email,
        name: profile.name,
        avatar: profile.avatar,
        emailVerified: true, // OAuth emails are pre-verified
        oauthAccounts: [{ provider, providerId: profile.id }]
      });
    }
  }

  // 4. Create session
  return createSession(user.id);
}

Read the full file on GitHub · 644 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 644 lines · 3 tokens per session scan A 8ce4480bb481

Subscribe to this mod's changes

saas-auth is a skill published in the GitHub repository TheWayWithin/agent-11 (15 stars, last pushed 13d ago), licensed MIT. It adds 3 tokens to every session and 4,279 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-04.