Search Posts
Search blog posts by title, description, tags, or content.
Authentication Refactoring and Legacy Migration
Day1 Company · Sep 2024 - Apr 2026
Tasks
- •Reorganized authentication responsibilities scattered across PHP sessions and frontend token issuance into a Java/Spring-based authentication server
- •Migrated to server-side JWT authentication and applied Refresh Token Rotation
- •Moved JWT signing from HS256 to an RS256/JWKS model and designed a GCP KMS signing flow with `kid`-based key rotation
- •Distributed only public keys to verification services and restricted signing authority to the authentication server and KMS permissions
- •Kept a legacy decoder that temporarily accepted existing HS256 tokens to enable a no-downtime migration
- •Defined a key-rotation order that considered JWKS cache TTL and access-token expiration
- •Migrated PHP legacy features such as authentication, user management, and API routing to Java to remove dual PHP/Java operation
- •Resolved a security issue where PHP session problems could expose another user's account information
- •Established a Spring OAuth2-based authentication flow
- •Configured a flow that exchanges external login results for service-owned tokens
- •Prepared an extensible structure for adding authentication providers
- •Improved maintainability and operations efficiency by consolidating authentication into service-owned OAuth
Achievements
- •Consolidated authentication responsibilities from frontend and PHP into a Java/Spring authentication server
- •Separated signing authority and verification authority so multiple services can verify tokens with public keys
Related Posts
Splitting Login Responsibility (2) - Connecting the authorize/callback Flow
How the frontend connects the login flow from protected page access to backend authorize, callback, and token issuance.
2026-04-16
Splitting Login Responsibility (3) - Verifying Old Tokens and New Backend Tokens Together
How I split verification order and failure handling when old frontend tokens and new backend-issued tokens had to be accepted through the same browser cookies.
2026-04-17
JWT Signing Migration - From HS256 to RS256/JWKS/KMS
How I split signing responsibility, kid, key rotation, and legacy token handling while moving symmetric JWT signing to RS256, JWKS, and KMS.
2026-04-24