authentication

Password reset flow that avoids user enumeration and token leaks

Password reset endpoints should reveal as little as possible about account existence. I return the same response for known and unknown emails, store only token digests, and invalidate tokens after first use. Small response details here prevent large i

TOTP based multi factor authentication for sensitive actions

I use MFA not only at login but also for high-risk step-up flows like email change or payout setup. TOTP is straightforward to implement if secrets are handled carefully and backup codes are part of the design. Recovery flow quality matters as much as

Password hashing with Argon2 and bcrypt migration paths

Passwords should never be encrypted for later recovery. I store slow one-way hashes, tune work factors for current hardware, and maintain a rehash path when users log in with older credentials. Argon2id is my first choice for new systems, while bcrypt

Laravel Sanctum for API authentication

Laravel Sanctum provides lightweight API authentication for SPAs and mobile apps. For SPAs on the same domain, Sanctum uses Laravel's session cookies with CSRF protection. For mobile apps or third-party clients, it issues API tokens stored in a person

Django REST Framework authentication with JWT

JWT tokens provide stateless authentication for APIs. I use djangorestframework-simplejwt for token generation and validation. The TokenObtainPairView issues access and refresh tokens on login. I configure token lifetimes in settings. For protected en

Sign in with Apple authentication

Sign in with Apple provides secure, privacy-focused authentication required for apps with third-party login. Users create accounts with Face ID or Touch ID, and Apple generates unique identifiers per app. I use ASAuthorizationController to initiate th

JWT authentication with refresh tokens

Stateless authentication with JWT tokens simplifies horizontal scaling but introduces security concerns around token lifetime and revocation. I use short-lived access tokens (15 minutes) combined with longer-lived refresh tokens stored in an encrypted

Security with Spring Security and JWT

Spring Security secures applications with authentication and authorization. I configure security with SecurityFilterChain bean defining protected and public endpoints. JWT (JSON Web Tokens) provides stateless authentication—tokens contain user claims

Django password reset flow with email

Django provides built-in password reset views. I customize templates to match site design. The flow sends a secure token via email that expires after a timeout. I configure email backend and PASSWORD_RESET_TIMEOUT in settings. For better UX, I customi