OAuth scopes

A scope is a string — read, orders:write, openid — that names a slice of access. A client asks for the scopes it needs, the user or policy grants some or all of them, and the issued token carries the granted set. Resource servers check the token's scopes before acting, so a token minted for reading cannot be used to delete.

How it works

Scopes travel in the scope parameter of the authorization or token request as a space-separated list, and come back in the token response — possibly narrower than requested. A JWT access token usually carries them in a scope or scp claim; an opaque token's scopes are found through introspection.

The misconception

That a token has the scopes you asked for. The server may grant fewer, and a client that assumes otherwise fails later, far from the cause. Read the scope field in the token response, and test what happens when a call needs a scope the token lacks.

Try it here

The token response from POST /auth/v1/oauth/token states the granted scope — read for client credentials, read write for the authorization code flow — and POST /identity/v1/introspect reports the scope of an Identity API token.

Sources

Other terms

All glossary terms · Testing techniques · All 39 mock REST APIs

Last updated