Beta

Create a tenant

A new tenant starts with its own users, OAuth settings, audit history and logs. You are its first Tenant Admin.

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 authenticator 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 session 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 OAuth 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-on 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 server at every refresh, and a reference access token is looked up through introspection, so revoking either takes effect at the next check. A self-contained access token is validated by the API 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:

When revoking access takes effect
Kind of accessWho checks itWhen revocation takes effect
Session at the identity providerThe provider, on every requestAt the next request
Session at an applicationThe application, against its own recordWhen the application's session expires, unless the application is told sooner
Refresh tokenThe authorization server, at each refreshAt the next refresh
Reference access tokenThe API, through introspectionAt the next lookup, after any time the API caches the answer
Self-contained access tokenThe API, locally, from its signature and expiryWhen 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 authorization 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 Connect, Back-channel logout already does this for one kind of change: the provider sends each application a signed logout token, 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.

The expense service verifies the event before acting on it. Without the event, its session for Riley would have lasted until it expired.

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 issuer 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.

A Cedar account is disabled at 10:00. Cedar's expense API accepts self-contained access tokens that last one hour, and it handles no security events. When does the account's access to that application end? 1 of 3

Choose one answer.

The expense service accepts any well-formed security event posted to its endpoint, without checking the signature or the issuer. What can an attacker do? 2 of 3

Choose one answer.

A Cedar employee changes their own password from their laptop, with no sign of compromise. Which response fits that change? 3 of 3

Choose one answer.

Try it in the Lab

We value your privacy

We use cookies and similar technologies to enhance your browsing experience, and analytics to understand our traffic. By clicking "Allow all", you consent to optional analytics. Cookie Policy

Learn identity