OIDC Token
An oidc token is a signed digital badge that proves who a user is. You get one by logging in through your identity provider using OpenID Connect. Many engineering teams use these tokens to replace static passwords across their tools. Still, teams often map these tokens to broad admin roles to save time. When a role is too broad, one valid login grants full database control. How an oidc token works in your login flow OpenID Connect sits on top of the OAuth 2.0 protocol to verify user identity.
Token Rotation + K8s OIDC Authentication: the complete guide
Architecture patterns, implementation strategies, and security best practices. Delivered to your inbox.
An oidc token is a signed digital badge that proves who a user is. You get one by logging in through your identity provider using OpenID Connect. Many engineering teams use these tokens to replace static passwords across their tools. Still, teams often map these tokens to broad admin roles to save time. When a role is too broad, one valid login grants full database control.
How an oidc token works in your login flow
OpenID Connect sits on top of the OAuth 2.0 protocol to verify user identity. First, a user tries to log in to an app or database tool. The app sends the user to a central identity provider like Okta or Google. The user enters their password and passes a second factor check there. Next, the identity provider creates an oidc token and signs it with a private key. This token is a JSON Web Token that holds plain facts about the user. These facts are called claims, and they list the user email and group names. The token also holds an expiration time so it cannot work forever. Finally, the user sends this signed token back to the target system. The target system checks the signature using a public key from the identity provider. If the signature matches and the time is valid, the user gets in.
How teams map identity claims to system roles
Once a system trusts the token, it must decide what the user can do. Teams set up rules that link token group claims to local system roles. For example, a developer group claim might map to a read and write role. An analyst group claim might map to a read-only role in the database. This setup keeps teams from making separate user accounts inside every single database. When someone leaves the company, you remove them from the central identity provider. Their token stops working, and they lose their roles across all linked systems.
What identity tokens solve and what they leave open
Using an oidc token fixes the problem of scattered passwords and shared static keys. You know for sure who logged in and when that login happened. Yet this setup only checks identity at the front door during login. Once the session starts, the token has done its entire job. It cannot see or stop what the user does inside that live session. A developer with a write role can still run a bad delete command. An analyst with a read role can still pull a table full of emails. They can also export phone numbers, card numbers, or national IDs in plain text. Native database roles are too blunt to inspect every single query in flight. They also cannot pause a risky command to ask a manager for approval. Data masking that rewrites matched fields in results is also missing from basic login flows.
Token Rotation + K8s OIDC Authentication: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Govern statements and responses across databases and APIs
Good config and scoped roles are needed setup. They do not check single queries in flight or mask sensitive fields in returned rows. Across Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, and internal HTTP endpoints, hoop.dev sits inline in the protocol beside each supported service as an open-source proxy, a sidecar for your database or API. For every query or command an AI agent or engineer runs against production, hoop.dev decides to pass, mask, block, or hold it for human approval.
First, hoop.dev guardrails block banned queries before they run or hold risky ones for review, and hoop.dev data masking rewrites matched sensitive values in responses in memory. Furthermore, hoop.dev holds SOC 2 Type II and is open source on GitHub.
Frequently asked questions
How is an ID token different from an access token?
An ID token proves who the user is and holds profile claims like email. An OAuth token grants permission to call a specific API or resource.
How does a database check if a token is real?
The database fetches the public keys from the identity provider web address. It uses those keys to verify the math signature on the token.
What happens when an identity token expires during a session?
The client app must use a refresh token or ask the user to log in again. Existing open database sessions often stay alive until the user closes them.
Related guides
In this post