python-auth-security
Installation
SKILL.md
Python Auth & Security
Overview
Security is not optional. OWASP Top 10 vulnerabilities remain the primary attack vector. This skill covers authentication, authorization, user management, and application security patterns for Python web apps. Every code pattern must follow these rules — no shortcuts.
Authentication Decision Framework
| Scenario | Method | Library |
|---|---|---|
| Web app with sessions | Session + cookies | Flask-Login |
| SPA + API | JWT (access + refresh) | flask-jwt-extended / python-jose |
| Enterprise SSO | OAuth 2.0 / OIDC | Authlib (recommended) |
| Legacy enterprise | SAML 2.0 | python3-saml (OneLogin) |
| Machine-to-machine | Client Credentials / mTLS | Authlib / httpx |
| LDAP/Active Directory | LDAP bind | ldap3 (pure Python) |
| API consumers | API keys (hashed) | Custom middleware |