Skip to main content

Overview

The backend uses three authentication mechanisms: All methods ultimately produce the same local JWT access token that subsequent API calls use.

JWT Authentication (Primary)

Key Pair

The backend signs tokens with an RSA private key and verifies them with the public key:
Algorithm: RS256 (RSASSA-PKCS1-v1_5 with SHA-256) Generate keys for local development:

Token Structure

Token Lifecycle

Token Expiry

Configured via env vars:

FastAPI Dependencies

Usage in route handlers:

Email/Password Login Flow


Email Verification

New accounts require email verification before accessing protected features:

Google OAuth

Sign in with Google

Google Search Console Integration


Microsoft OAuth


AWS Cognito Auth

Used when users authenticate via the auth.webyes.com portal:
Configuration:

Permission System

Architecture

Permission Slugs

Format: scope:resource:action

Redis Cache

On startup, all role→permission mappings are cached in Redis:

Permission Check

Used in route handlers in addition to verify_token:

Rate Limiting

Sensitive endpoints are rate-limited via SlowAPI (10 requests/minute per IP): On exceeding the limit: HTTP 429 Too Many Requests