MyCLI

Authentication

Authentication Guide

MyCLI generates a complete authentication system supporting multiple strategies.

Strategies

| Strategy | Description | |----------|-------------| | JWT | Access tokens with configurable expiry | | Refresh Token | Long-lived refresh token rotation | | Session | Server-side session (via @fastify/session or express-session) | | OAuth | Google, GitHub, Facebook providers | | Magic Link | Passwordless email-based login | | OTP | One-time password via email/SMS | | Passkeys | WebAuthn/FIDO2 passkey authentication | | MFA | TOTP-based multi-factor (Google Authenticator compatible) |

Setup

my add auth
# Or with specific strategies:
my create api --auth --auth-strategies jwt,refresh-token,oauth,mfa

Generated Files

ORM Support

Templates adapt to your configured ORM:

Enterprise SSO

my add enterprise-auth --providers google,azure-ad,keycloak,saml,ldap

Generates providers for: