debug-auth

A guided workflow for diagnosing authentication, which proves who a user or service is, and authorization, which decides what it may do.

In plain words
What is it for?
Use it to check OpenFGA, Redis, Keycloak, and PostgreSQL, test permissions and tuples, inspect authentication logs, and investigate tokens, sessions, or authorization settings.
Why use it?
It checks the supporting services, configuration, logs, permissions, and session storage so you can narrow down why access is failing.

Command for Claude Code

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 commands/vishnu2kmohan/mcp-server-langgraph/debug-auth
Clone the repo
git clone --depth 1 https://github.com/vishnu2kmohan/mcp-server-langgraph

Made for: Claude Code.

Per session 8 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 554 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 $0.00008 $0.00554
Opus 5 $0.00004 $0.00277
Sonnet 5 $0.00002 $0.00111
Haiku 4.5 $0.00001 $0.00055

Measured 2d ago against content hash 089e7508ee32, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

debug-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 2d ago.

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/commands/debug-auth.md · 98 lines

How it starts

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

Debug Authentication Issues

Comprehensive authentication and authorization debugging workflow.

Debug Steps

  1. Check Infrastructure Status

    make health-check
    

    Verify:

    • OpenFGA is running (port 8080)
    • Redis is running (port 6379)
    • Keycloak is running (port 8081)
    • PostgreSQL is running (port 5432)
  2. Test OpenFGA Authorization

    make test-auth
    

    Runs example OpenFGA usage script to verify:

    • Connection to OpenFGA
    • Permission checks
    • Tuple writes and reads
  3. Review Authentication Logs

    Quick log access:

    make logs-follow        # Follow all logs
    make logs-agent         # Agent logs only
    

    Filter for auth issues:

    docker compose logs -f --tail=100 | grep -i "auth\|jwt\|token"
    
  4. Check Session Management

    • Verify Redis connection
    • Check session store configuration
    • Review session metrics
  5. Validate OpenFGA Configuration

    • Check OPENFGA_STORE_ID in .env
    • Check OPENFGA_MODEL_ID in .env
    • Verify authorization model is loaded

Common Issues

Issue: JWT Token Validation Fails

  • Check JWT_SECRET_KEY is set correctly
  • Verify token expiration settings
  • Check for clock skew between services

Issue: OpenFGA Permission Denied

  • Verify tuples are written correctly
  • Check user-role-resource relationships
  • Review role mappings in config/role_mappings.yaml

Issue: Session Not Found

  • Check Redis connectivity
  • Verify session TTL settings
  • Review session store backend configuration

Interactive Debugging

Web UIs

  1. OpenFGA Playground: http://localhost:3001
  2. Prometheus Metrics: http://localhost:9090 (search for auth_* metrics)
  3. Grafana Dashboards: http://localhost:3000 (Authentication dashboard)

Quick access:

make prometheus-ui    # Opens Prometheus
make jaeger-ui        # Opens Jaeger (for tracing)

Component Logs

View specific component logs:

make logs-prometheus  # Prometheus logs
make logs-grafana     # Grafana logs

Read the full file on GitHub · 98 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. 2d ago First seen · 98 lines · 8 tokens per session scan A 089e7508ee32

Subscribe to this mod's changes

debug-auth is a command published in the GitHub repository vishnu2kmohan/mcp-server-langgraph (4 stars, last pushed 9d ago), licensed MIT. It adds 8 tokens to every session and 554 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-08-31.