Dex IdP custom token claims from Postgres
· 2 min read
Consider a multi-tenant SaaS app. After login, your app still needs to know:
- which org is this user in
- what's their role
- are they on a paid plan
- ... ...
And users may authenticate through different connectors (password, LDAP, external IdP) - the token needs consistent user context regardless.
This post covers a Dex fork that enriches issued tokens with custom claims - statically or from a Postgres query.
Checkout the changes at github.com/edgeflare/dex.
Or use the image right-away ghcr.io/edgeflare/dex with the environment variables.