Envoy OIDC
You set up an envoy oidc flow by linking a filter to your identity provider. This checks user logins before traffic reaches your internal web apps. Many engineering teams use this method to add single sign-on to older services. They put the filter at the edge so every app need not manage tokens. Still, broad role rules at the edge often give logged-in users too much power. Once a user passes the first login screen, they can run risky requests inside. How the envoy oidc login workflow operates
Your coding agents run with your access.
Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.
You set up an envoy oidc flow by linking a filter to your identity provider. This checks user logins before traffic reaches your internal web apps. Many engineering teams use this method to add single sign-on to older services. They put the filter at the edge so every app need not manage tokens. Still, broad role rules at the edge often give logged-in users too much power. Once a user passes the first login screen, they can run risky requests inside.
How the envoy oidc login workflow operates
The filter sits in the network path right in front of your upstream service. When a user visits an internal URL, the filter checks for a valid cookie. If the request has no cookie, the filter pauses the original web request. It then redirects the user browser over to the external identity provider login page. The user enters their name, password, and MFA code on that provider screen.
After a valid login, the identity provider sends the browser back to a callback URL. This redirect carries an authorization code in the query string for the filter. The filter reads this code and makes a direct backend call to the provider. It trades the temporary code for a signed token that proves who the user is. Next, the filter stores the session state in browser cookies for future requests. Finally, it sends the user request along to the upstream app behind it.
On the next click, the browser sends those saved cookies back with the request. The filter checks the cryptographic signature on the cookie to make sure it is valid. If the signature matches and the time limit is good, the traffic passes through. The upstream app does not need to run its own complex login logic.
Why teams pair token checks with claim rules
A basic login check only proves that a person has an active company account. It does not check if that person belongs to the right engineering team. To fix this, platform teams add a second filter that reads JSON web tokens. This second step pulls group claims and role names out of the verified token. It can also copy those claims into plain HTTP headers for the upstream app.
Teams then write match rules that check these headers against the requested URL path. For example, a rule might allow only finance group members to open billing pages. Another rule might block standard users from sending delete calls to an admin path. Managing these header rules across dozens of services takes steady work and careful testing. One wrong path match can expose an internal admin tool to the whole company.
K8s OIDC Authentication + Envoy Proxy Security: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
What edge login solves and what gaps remain
This edge setup solves the hard problem of adding single sign-on to internal web apps. You get one place to enforce multi-factor login and central session time limits. When someone leaves the company, you disable their main account in the identity provider. Once the short cookie expires, the edge filter blocks their next web click.
Still, an edge login filter only decides who can enter the front door. It does not understand the deep payload of API calls or database queries inside. Once a developer passes the login check, their session has full trust for that route. The native filter does not pause a risky delete call to ask a peer. It also does not mask emails, phone numbers, or card numbers in response data. Plus, edge filters only guard HTTP traffic, leaving direct database or shell sessions outside.
Add response masking and path guardrails beside HTTP APIs
Tokens, OAuth scopes, and network rules govern who reaches an internal HTTP endpoint. Even so, an allowed service or agent can call a delete method or get raw personal data in a JSON response. In practice, hoop.dev runs beside the service as a sidecar for your HTTP API and checks requests and responses alongside your existing API auth.
With hoop.dev HTTP controls, guardrails refuse disallowed paths, methods, and headers before they reach the service. Data masking rewrites sensitive JSON keys in responses in memory before they return to the client. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and generates evidence for GDPR, HIPAA, and PCI DSS programs. View the source on GitHub.
Frequently asked questions
Does the OIDC filter validate user roles on its own?
No, the base login filter only checks that the user signed in with the provider. To check roles or group claims, you must pair it with token and rule filters.
How does the filter handle expired user sessions?
When the session cookie reaches its time limit, the filter rejects the old cookie. It then sends the browser back to the identity provider to get a fresh token.
Can this filter protect raw database or SSH traffic?
No, the login flow relies on HTTP redirects and browser cookies to do its job. Raw database protocols and terminal tools cannot follow web redirects or store browser cookies.
Related guides
In this post