OpenID Connect (OIDC) makes authentication simple, but that simplicity can hide dangerous cracks where sensitive data slips through. Tokens, claims, and user info endpoints often carry far more than just a username. Mishandled, they leak private attributes—email addresses, profile data, even internal system identifiers—that attackers can weaponize.
OIDC sits on top of OAuth 2.0, adding identity in the form of ID tokens and user claims. Those claims are where sensitive data lives. By default, many identity providers include extra information that’s not strictly needed for your application to function. It’s tempting to just pass everything along to downstream services. That’s the mistake.
When ID tokens are logged, cached, or stored in browser storage, they persist in places you can’t control. When claims flow unchecked between microservices, they can be exfiltrated without triggering obvious alerts. And when refresh tokens are handed to client-side apps, you’ve effectively gifted permanent access without a kill switch.
To protect sensitive data in OIDC: