Skip to content
Workforce IdentityMarkdown

Governed scopes

Issue a scope only to the users, groups and agents an entitlement grants it to, with broad grants implying narrower ones.

AvailableAPIRFC 6749 §3.3, RFC 8707

Once an entitlement names a scope, that scope is governed: the realm issues it only to someone who holds an entitlement naming it, directly or through a group. Every other scope is issued as the client and the realm allow, as before. So a realm that writes no entitlements sees no change, and you opt in one scope at a time, by writing the entitlement that governs it.

Governed scopes are how a scope such as invoices:write stops being something any client can ask for and becomes something only the finance team holds.

  • Who can do it: a realm administrator, in a group that holds RealmOwner (Delegated administration). RealmViewer can read entitlements.
  • Where: today this is done through the API (Call the API shows how to get $CVYUH_SESSION).
  • First: the entitlement that names the scope; see Entitlements.

maya, a member of the finance group, which holds the invoices entitlement, asks for invoices:read for https://app.example.com/api, and is issued it. ben, outside the group, asks for invoices:read profile and is issued profile alone, and the token response’s scope says so.

  • Broad implies narrow. An entitlement lists every scope it grants, at least one. One that lists invoices, invoices:read and invoices:write lets its holder be issued invoices:read alone.
  • Scopes for named APIs. An entitlement may name the resources its scopes are for. Its scopes are then issued only for a token whose audience is among them. One that names none is for every API.
  • Time-boxed. A grant may have a window, and so may the entitlement itself. Once either closes, its scopes stop being issued. Nothing has to be revoked or swept.
  • Narrowed, not refused. A governed scope someone lacks is left out of the token, and the response says which scopes were issued. The request is refused invalid_scope only when nothing it asked for is left.
  • Checked again. Every refresh, exchange and introspection checks a token’s governed scopes again. When a grant lapses, a refresh no longer carries its scope, and a token that still holds it reads as inactive.

Write an entitlement (see Entitlements) that names the scope, and grant it. From the moment the entitlement exists, the scope is governed.

{ "code": "invoices", "scopes": ["invoices", "invoices:read", "invoices:write"],
"resources": ["https://app.example.com/api"] }

A user who lacks a governed scope still signs in: the token leaves the scope out, and the response’s scope says which were issued. Only when nothing they asked for is left is the request refused, with invalid_scope.

Setting or limitDefaultRange
Governed scopesnone, until an entitlement names oneany scope but sign-in and platform scopes
Entitlements in a realmfewer than 1,000
SymptomCauseFix
A scope that used to be issued to everyone is now left outAn entitlement now names it, so it’s governedGrant the entitlement to everyone who needs it
A token reads inactive at introspectionA grant behind one of its scopes lapsedRenew the grant; the next sign-in gets a fresh token

Each token request’s TOKEN_ISSUED record holds what was asked (asked.scope) and what was granted (granted.scope), so a governed scope left out is visible (Audit → Authentication).

  • Sign-in and platform scopes can’t be governed. An entitlement can never name a sign-in scope (openid, profile, email, address, phone, offline_access) or a scope the realm’s own services need (platform:admin, keys:admin, policies:read, revocations:read, access:evaluate, access:search, ssf.manage). Writing one is refused. Governing a sign-in scope would take sign-in away from every client with no grant.
  • A client acting as itself holds no grants, so a governed scope is never issued to it.
  • A lapsed entitlement still governs. Letting it lapse takes its scopes away, rather than freeing them for everyone.
  • Structured permissions are governed the same way. A type of authorization_details that some entitlement names is governed like a scope, except that an object no held template admits is refused, never narrowed. See Rich authorization requests.