Revoking access and sharing security events
Once Cedar knew someone else was using Riley's account, every copy of that access had to end, and each kind ends in its own way and at its own time. This lesson compares how sessions, refresh tokens and access tokens end, explains the gap before a token expires, shows how a security event tells another company's application what changed, and sets out what each kind of change should end.
Ending access you did not grant
On Day 2, at 08:50, an alert reached Cedar's security team. It combined three weak signals on Riley's account: a sign-in from a hosting provider, a new authenticatorSomething a person controls and uses to prove control of an account, such as a memorized password, an app that generates one-time codes, or a security key. It counts only after it has been registered to that account. added minutes later, and a network Riley had never used. Quinn, who led the investigation, confirmed that someone other than Riley had been using the account since the previous morning. Once the records the investigation needed were preserved, that person's access had to end, and it was spread across more places than a single account setting.
The familiar tools are signing out everywhere and changing the password. Signing out everywhere invalidates every sessionThe ongoing connection between later requests and an earlier sign-in, so you are not asked for your password on every click. It is often tracked with a cookie holding an unpredictable session identifier. record the identity provider holds for the account and, at most providers, the refresh tokens it issued, the server-side ending that Staying signed in called for. A refresh token, as the OAuthA framework that lets a person give an application limited access to their resources at another service, using tokens instead of sharing their password. OAuth is about access; OpenID Connect adds sign-in. lessons explained, lets an application get new access tokens without the person signing in again, so leaving one in place leaves the application's access in place. Changing the password helps only if the change also ends existing sessions. The attacker had not needed Riley's password since 09:14 the previous day, because they had the session the relay captured. Providers that record which version of the credential each session was created with can end every older session when the password changes, usually keeping the one that made the change.
Both actions reach only what the identity provider controls. Each application the account was used to open through single sign-onSigning in once and then using several applications without entering credentials again, usually because they all rely on the same identity provider. created a session of its own, as Trust across systems explained, and access tokens already issued to applications are checked by the APIs that receive them, not by the provider. Signing out everywhere at the provider leaves those in place until something else ends them.
Some of what the attacker left is not a session at all: the authenticator app they registered, the mail access they granted to a third-party app called "Invoice Sync", and a mail forwarding rule. No sign-out removes these: each needs its own removal, and a response that stops at signing out leaves all three working. How attackers stay in and Containing and recovering follow that cleanup in detail.
Each kind of access ends differently
Whether a revocation takes effect at once depends on who checks the credential, and how. A session at the identity provider is a record in the provider's own storage. Each request looks it up, so deleting the record ends the session at the next request.
An application's own session works the same way, except that the record belongs to the application and the provider cannot delete it. The application learns that something changed only when the person goes back to the provider, when its own session expires, or when someone tells it.
Tokens follow the same rule. A refresh token is checked by the authorization serverIn OAuth, the service that handles a person's sign-in and approval and decides which tokens to issue to a client. It may belong to the same company as the API, but its job is separate. at every refresh, and a reference access tokenA token that a client presents to an API to use access it has been granted, usually limited in what it allows and how long it lasts. It authorizes API calls; it does not tell the client who signed in. is looked up through introspectionA way for an API to ask the authorization server what a token means: whether it is still active and what access it carries. APIs need it when a token is a random string that only the authorization server can interpret., so revoking either takes effect at the next check. A self-contained access token is validated by the APIAn application programming interface: a defined way for software to interact with a service. A web API offers endpoints where other programs send HTTP requests. on its own and keeps working until it expires, as Token revocation explained. Put together with sessions, the picture for Riley's account looks like this:
| Kind of access | Who checks it | When revocation takes effect |
|---|---|---|
| Session at the identity provider | The provider, on every request | At the next request |
| Session at an application | The application, against its own record | When the application's session expires, unless the application is told sooner |
| Refresh token | The authorization server, at each refresh | At the next refresh |
| Reference access token | The API, through introspection | At the next lookup, after any time the API caches the answer |
| Self-contained access token | The API, locally, from its signature and expiry | When the token expires |
The gap before a token expires
The time between revoking access and the moment every copy stops working is the revocation gap. For a self-contained access token, it can be the token's whole lifetime. Suppose Cedar's expense API accepts self-contained tokens that last 30 minutes, and an employee's account is disabled at 13:45. Refresh fails from then on, so no new tokens are issued, but a token issued at 13:40 keeps working until 14:10.
There are two main ways to shrink the gap. Short lifetimes bound it directly: a token that lasts five minutes cannot outlive a revocation by more than five minutes, at the cost of more frequent refreshes. Introspection closes it for tokens the API looks up on each request, at the cost of a call to the authorizationDeciding whether a requested action is permitted, such as whether a signed-in account may delete a particular photo. Authentication says which account is asking; authorization decides what it can do. server every time and a dependency on that server being available. Many APIs cache introspection answers briefly, which brings back a small gap in exchange for speed. Token revocation and Token introspection described both endpoints.
A common middle path uses short-lived self-contained tokens for ordinary calls and a fresh check for the operations that matter most, such as changing payment details. The gap is then a few minutes for reading data and close to nothing for the riskiest actions.
Application sessions are often the widest gap of all. A session an application created through single sign-on might last a full working day, and short token lifetimes do nothing to shorten it. Closing that gap needs the identity provider to tell the application what changed. For applications that sign people in with OpenID ConnectAn identity layer on top of OAuth 2.0 that lets an application sign people in with an account at another service. It adds the ID token, standard claims, and discovery to the OAuth exchange., Back-channel logout already does this for one kind of change: the provider sends each application a signed logout tokenA signed JWT that an OpenID Provider sends directly to a relying party's server to say that a person's session at the provider has ended, naming them by sub, sid, or both. The relying party validates it like an ID token and ends its own matching session., server to server, naming the sessions to end.
Telling other systems what changed
Cedar's staff sign in to the expense service at expenses.example, which another company runs, through Cedar's identity provider. When Cedar ends Riley's sessions, the expense service cannot know unless Cedar sends word. A logout token would end the expense sessions, but Cedar also wants to say why, and to report changes that end no session at all, such as a changed credential. Cedar and the expense service already share a stream under the OpenID Shared Signals Framework (SSF), so Cedar's identity provider, the transmitter, sends the expense service a signed Security Event Token describing what happened. Continuous access evaluation covered how such streams are set up, what a security event token contains, and the CAEP and RISC event types, from a revoked session to a compromised credential.
Here is the event Cedar sent, decoded:
Header
{
"alg": "ES256",
"kid": "cedar-events-2026-01",
"typ": "secevent+jwt"
}
Payload
{
"iss": "https://login.cedar.example",
"aud": "https://expenses.example",
"jti": "evt-5b1d93e0",
"iat": 1773221400,
"sub_id": {
"format": "iss_sub",
"iss": "https://login.cedar.example",
"sub": "usr_4182"
},
"events": {
"https://schemas.openid.net/secevent/caep/event-type/session-revoked": {
"event_timestamp": 1773221340,
"initiating_entity": "admin"
}
}
}It names Riley by the issuerThe party that creates and signs a token, assertion, or certificate, named in a token's iss claim. A recipient must check that the issuer is exactly the one it expected and trusts. and subject the expense service already stores, says the session was revoked a minute before the event was issued, and says an administrator did it. It carries no email address, password or free-text reason, only what the receiver needs to act. The expense service checks it as carefully as a sign-in before ending Riley's sessions there, because an endpoint that acted on any well-formed event would let anyone sign Cedar's staff out at will.
Deciding what a change should end
Not every change should end everything. Ending all sessions whenever anything changes signs people out so often that they stop paying attention, and it floods the help desk. Ending too little leaves an attacker in place. The useful question for each change is what it says about the access that already exists.
- A password the person changed themselves: end their other sessions and refresh tokens, and keep the session that made the change.
- A suspected compromise: block new sign-ins, end every session and refresh token, send events to the applications that receive them, and remove the sign-in methods and app grants the attacker added.
- An account disabled because someone left: end everything, everywhere, including application sessions.
- A role removed: check authorization again at each application. Signing the person out is often unnecessary, but a token that carries the old role should not outlive the change by long.
- A new sign-in method added: usually nothing needs to end, but the owner should be told, and a method added from an unfamiliar network deserves a closer look.
Riley's case was the second kind. Each revocation and each event sent or received belongs in the records too, with who triggered it and why, so that an investigation can later show when every kind of access actually ended.
Check your understanding
Try these questions before moving on. If an answer isn't right, use the feedback and try again.
Try it in the Lab
- End access and tell another system with a security eventCreate a Shared Signals stream, lock one person and compare what ends at once with what another system must be told, then watch the lab receiver accept each event.