authentication-security

Implement OAuth2 flows with PKCE and RS256 JWT signing.

17|1|Updated Jun 8, 2025
One-click install
npx skills add https://github.com/williamzujkowski/standards --skill authentication-security
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: authentication-security
Source: https://github.com/williamzujkowski/standards/tree/main/skills/security/authentication
Command: npx skills add https://github.com/williamzujkowski/standards --skill authentication-security

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Authentication security standards cover OAuth2 flows, JWT best practices, MFA, session management, and NIST 800-63B compliance.

Core Features & Use Cases

  • OAuth2 & PKCE: Secure authorization flows for public clients.
  • JWT Best Practices: RS256 signing, short-lived tokens, and rotation.
  • MFA & Session Security: TOTP/WebAuthn, httpOnly cookies, and CSRF protection.

Quick Start

Implement an OAuth2 flow with PKCE for a SPA and issue RS256-signed JWTs with short lifetimes.

Frequently Asked Questions about authentication-security

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

FAQPage Schema
How do I implement OAuth2 with PKCE for secure authorization?

OAuth2 with PKCE provides secure authorization for public clients by using dynamic code challenges instead of static secrets. Implement the authorization code flow with PKCE by generating a code verifier, creating a code challenge, redirecting users to the authorization endpoint, and exchanging the authorization code with the code verifier for tokens. This protects against authorization code interception attacks.

What's the best way to sign and validate JWTs in production?

Use RS256 asymmetric signing with a private key to issue JWTs and validate them with the public key. Issue short-lived access tokens with rotation mechanisms, store the private key securely, and validate token signatures, expiration, and claims on every request. This approach scales across multiple services and prevents token tampering.

How do I add multi-factor authentication to my authentication system?

Integrate MFA by implementing TOTP or WebAuthn as second factors after password verification. Store MFA credentials securely, validate one-time passwords or cryptographic proofs during login, and maintain session state only after both factors succeed. This significantly reduces account compromise risk.

Does this authentication approach comply with NIST 800-63B standards?

Yes, the implementation satisfies NIST 800-63B requirements including RS256 JWT signing, short-lived tokens, PKCE for public clients, MFA support, secure httpOnly cookies, CSRF protection, and audit logging. It aligns with identity assurance and cryptographic controls outlined in IA-2, IA-5, IA-8, AC-7, SC-8, and SC-13.

How do I protect sessions and prevent CSRF attacks?

Use httpOnly, Secure cookies to store session tokens, preventing JavaScript access and ensuring HTTPS-only transmission. Implement CSRF tokens in state-changing requests, validate token rotation on each new session, and maintain short session lifetimes. These controls prevent unauthorized token theft and cross-site request forgery.

Can I use this authentication system for both web and mobile backends?

Yes, the OAuth2 authorization code with PKCE flow and RS256 JWT validation work across web SPAs and mobile clients. Issue short-lived access tokens and refresh tokens, validate JWTs on API requests, and support platform-specific MFA factors like WebAuthn or TOTP for both client types.