Home / Companies / WorkOS / Blog / Post Details
Content Deep Dive

Stop Using Email as a Primary Key—Before It Bites You

Blog post from WorkOS

Post Details
Company
Date Published
Author
Zack Proser
Word Count
1,722
Company Posts That Month
32
Language
English
Hacker News Points
-
Post removed?
No
Summary

Email addresses should be treated as mutable contact information rather than permanent user identities because employers and consumer providers can reassign or recycle them, potentially allowing a new holder to inherit access to a previous user’s account. OpenID Connect provides a more durable identity through the combination of the issuer (`iss`) and subject (`sub`) claims, which should be stored as a unique provider identity linked to an internal user record, while email remains profile data. Automatically linking accounts from different providers based solely on matching email addresses can enable account takeovers, particularly when a provider permits unverified email claims. Safer approaches require users to connect additional login methods while already authenticated or, if linking during sign-in is necessary, require both current inbox-access verification and explicit confirmation. Even provider-reported `email_verified` status may be stale or insufficient, so verification should be recent and tied to the linking event. Systems should also synchronize email changes carefully, reject collisions rather than merge accounts, remove identities verified against an old address, and revoke active sessions when needed after an email change.

Trends Found in this Post
Trend Post Mentions Total Month Mentions Posts Companies MoM
Platform Engineering 2 154 51 23 -88%
Use This Data

Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.