Your identity provider is the front door to your entire company. We hand the keys to services like Okta, Auth0, or Azure AD and trust them to tell us who's friendly and who isn't. But the recent 1Password security event shows just how thin that trust can be. An authenticated session from your IdP isn't a free pass, and if you're treating it like one, you're building on a shaky foundation.
As Hacker News reported, 1Password recently detected and stopped an intrusion that started in their Okta instance. An attacker gained access to an employee's account and tried to make a move. This is the exact scenario that keeps CTOs up at night. You've outsourced identity, and now a third party's problem has become your five-alarm fire. But the attacker failed. They got in the front door but couldn't get anywhere useful. And the reason why is the most important lesson for any team building software today.
It wasn't Okta's security that saved them. It was 1Password's own internal, application-level security. The attacker was blocked by a system that required explicit, human admin approval for the action they were trying to take. This wasn't about the initial authentication. It was about authorization, and it's a distinction that most teams get wrong.
Beyond the Binary isAuthenticated Flag
For years, the standard playbook for auth has been simple. You wrap your routes in a piece of middleware. It checks for a valid session cookie or a bearer token. If the token is valid, you set request.user to some object and a boolean flag like isAuthenticated to true. If not, you kick them back to the login page. Done.
It's a simple, binary world. You're either in or you're out. The problem is, this model treats a user who just passed MFA a second ago the same as a user with a stale session from three days ago on a public computer. It treats a session from a corporate laptop the same as one from a personal phone in a new country. All the context is lost.
The attacker in the 1Password case was, for all intents and purposes, isAuthenticated. They had a valid session from the identity provider. If 1Password's internal systems relied on that simple binary check, this story might have had a very different ending. The real failure of modern identity provider security is treating authentication as a one-time event that grants permanent, context-free trust. Your IdP can tell you who a user is, but it's up to your application to decide what that user, in their current context, is allowed to do.
Trust, But Verify Your JWTs
When you use an IdP like Okta, the proof of authentication usually comes in the form of a JSON Web Token (JWT). It's a signed, self-contained token that proves a user has logged in. Most developers just verify the signature and call it a day. If the signature is valid, the user is legit. But that's only half the story.
A JWT isn't just a signature, it's a collection of claims. These are key-value pairs that contain information about the user and the authentication event itself.
sub: The subject, or user ID.iss: The issuer, who created the token (e.g., your Okta domain).aud: The audience, which service the token is for.exp: The expiration time.amr: Authentication Methods References. This is a critical one. It's an array that tells you how the user authenticated. Did they use a password (pwd)? Did they use MFA (mfa)?
This is where you move from authentication to authorization. A service that handles something sensitive, like deploying a new version of your app or accessing financial records, shouldn't just check for a valid signature. It should inspect the claims.
Let's say you have a critical admin endpoint. Your middleware shouldn't just be checkJwt. It should be checkAdminJwtWithMfa.
Here’s a simple pseudo-code example for an Express.js server:
// A basic JWT check -- what most people do
function checkJwt(req, res, next) {
const token = getTokenFromHeader(req);
if (!verify(token, JWT_SECRET)) {
return res.status(401).send('Unauthorized');
}
req.user = decode(token);
next();
}
// A better, claim-aware check for a sensitive endpoint
function checkAdminJwtWithMfa(req, res, next) {
const token = getTokenFromHeader(req);
if (!verify(token, JWT_SECRET)) {
return res.status(401).send('Unauthorized');
}
const claims = decode(token);
// 1. Check for the admin role
if (!claims.roles || !claims.roles.includes('admin')) {
return res.status(403).send('Forbidden: requires admin role');
}
// 2. Check that MFA was used for this session
if (!claims.amr || !claims.amr.includes('mfa')) {
return res.status(403).send('Forbidden: requires recent MFA');
}
// 3. (Optional but good) Check token audience
if (claims.aud !== 'my-critical-admin-service') {
return res.status(403).send('Forbidden: invalid token audience');
}
req.user = claims;
next();
}
The first function is what you get out of the box with most libraries. The second function is where you start building real identity provider security. It's opinionated. It knows that this specific service requires not just any valid user, but an admin who has proven their identity recently with a strong second factor. The attacker in the 1Password case might have gotten past the first check, but would likely have been stopped by the second.
The Real Lesson: Application-Level Authorization
The most important detail in 1Password's blog post is that the attacker's attempt to access a system was blocked because it required an admin's explicit approval. This is the crucial layer that sits on top of your IdP integration. It’s your application’s own logic, not something you can buy from a vendor.
This is a pattern we at AgileStack implement for clients handling sensitive data or operations. Don't grant standing permissions, grant just-in-time (JIT) access based on specific actions. An identity provider tells you who someone is. Your application code must decide what they can do right now.
What does this look like in practice? It means building internal choke points for high-risk actions.
- Changing production firewall rules? That shouldn't be a single API call. It should trigger a flow that requires approval from another engineer via a Slack message or an internal dashboard click.
- Exporting a full customer list? This action should require re-authentication, even if the user has a valid session. Force them to enter their password and MFA token again. This is known as step-up authentication.
- Provisioning a new admin account? This should be a multi-party operation. One person requests it, and another person with the appropriate permissions approves it. PagerDuty calls this "Secure Actions", and it’s a powerful pattern.
These aren't features of your IdP. They are features of your application architecture. 1Password was safe because they built a system that assumed a breach could happen. They didn't trust the isAuthenticated flag from Okta. They layered their own business logic on top, creating a human-in-the-loop process for a dangerous action. That's real defense in depth.
What This Means for Your Architecture
The 1Password incident isn't a story about a specific vendor's failure. It's a blueprint for how to build more resilient systems in a world where we rely on third-party identity. It's time to stop thinking of your IdP as a security solution and start thinking of it as a security component, one that can and will have issues.
Here are the takeaways for your team:
- Audit your IdP integration. Don't just assume it's secure. Look at every service that consumes tokens from your IdP. What claims are you checking? Are you just verifying the signature, or are you enforcing context like MFA usage and token audience?
- Treat your IdP as part of your threat model. What happens if your Okta, or Auth0, or Google Workspace is compromised? Which systems would an attacker have immediate access to? If the answer is "everything", you have a single point of failure.
- Build application-level choke points. Identify the top 5-10 most dangerous actions a user could take in your systems. This could be data deletion, configuration changes, or user permission escalation. Build explicit, application-aware security around those actions. This might be step-up auth, manual approvals, or detailed audit logging.
- Shrink the blast radius of a session token. A token shouldn't be a master key. Use scopes and audience claims (
aud) to ensure that a token intended for the wiki can't be used to access the production database control panel. Each service should only trust tokens specifically created for it.
This is a shift in mindset. Instead of assuming an authenticated user from your IdP is trusted, you should assume they are untrusted until they prove otherwise within the context of your application. An authenticated token is the start of the security process, not the end.
So, take a look at your most critical API endpoint. Find the code that handles authorization. Ask yourself: what if an attacker with a valid session token from our IdP calls this? If the answer is anything other than "they would be blocked by multiple, application-specific checks," you have work to do. The 1Password incident is your warning.
Building something in this space? AgileStack helps teams ship enterprise-grade software without the consulting-firm overhead. Book a 30-minute call and tell us what you're working on.