OIDC Scopes in Okta: Asking for Exactly What You Need
A friendly, book-style guide to how OpenID Connect scopes work in Okta: what each scope unlocks, how authorization servers and policies decide what is granted, and how to design scopes that are safe, simple, and production-ready.
Imagine you are checking into a big hotel. At the front desk you do not receive a single master key that opens every door in the building. Instead, the clerk asks what you need: just your room, or the gym and the pool as well? You get a key card that opens only the doors you asked for and were allowed to have. If you lose the card, the damage is small, because the card never opened the kitchen, the staff office, or the safe.
OpenID Connect scopes work like those key-card permissions. When an application wants to sign a person in through Okta, it does not get unlimited access to everything Okta knows. It names the specific things it needs, and Okta decides whether to say yes. This guide explains that idea slowly and clearly, from the very first word to the design choices that experienced architects make in real systems.
1What Is a Scope?
A scope is simply a named permission that an application asks for when it talks to Okta.
The plain-English definition
A scope is a short word, such as openid, email, or profile, that describes one slice of access. An application includes a list of these words when it sends a person to Okta to sign in. Each word is a request: “Please let me see this kind of information” or “Please let me do this kind of action.” Okta reads the list, checks its rules, and then either grants the scopes, grants only some of them, or refuses the request.
Scopes exist because of a very old and very sensible security idea called least privilege. Give every person and every program the smallest amount of access that lets them do their job, and nothing more. A calendar widget that only needs to show your name should never be able to read your phone number. A scope is how that limit is written down in a form that computers can check.
Think of a permission slip for a school trip. The slip does not say “my child may go anywhere with anyone.” It says exactly which trip, which day, and which activities are allowed. A scope is a tiny permission slip that an application hands to Okta, and Okta stamps it only for what is allowed.
Why this matters for everyday people
Every time you press a “Sign in with your company account” button, scopes are working quietly behind the scenes. They decide whether the app learns just that you are a real, signed-in person, or whether it also learns your email address, your department, or your group memberships. Good scope design protects both the person using the app and the company that owns the data.
A scope describes what an application is allowed to ask for. It does not describe what a human being is allowed to do. That difference becomes very important later in this guide.
2OAuth 2.0 and OpenID Connect in Five Minutes
You cannot understand scopes without knowing the two protocols they live inside.
OAuth 2.0: the permission system
OAuth 2.0 is a standard way for one program to be given limited access to something that belongs to a person, without that person handing over their password. The thing being protected is often called a resource, and the program that guards it is called a resource server. The program that wants access is called the client. The person who owns the data is the resource owner. The trusted referee in the middle is the authorization server, and in this guide that referee is Okta.
When access is approved, the client receives an access token. An access token is like a short-lived wristband at a music festival. It proves you were checked at the gate and tells the staff which areas you may enter. The wristband carries the scopes that were approved.
OpenID Connect: the identity layer
OAuth 2.0 alone answers the question “may this program do something?” It was never designed to answer “who is the person signing in?” OpenID Connect, usually shortened to OIDC, adds that missing piece on top of OAuth 2.0. It introduces the ID token, which is a signed note from Okta saying who the person is, how they signed in, and when.
OIDC also adds a special scope named openid. When a client includes that one word in its request, it is telling Okta, “I am doing a sign-in, so please treat this as an OIDC request and give me an ID token.” Without it, you are doing plain OAuth 2.0 and no identity layer is switched on.
Resource Owner
The person who owns the data and decides whether to allow access.
Client
The application asking for access, such as a web app or a mobile app.
Authorization Server
Okta, which checks the request and issues tokens.
Resource Server
The API or service that accepts tokens and protects the data.
OAuth 2.0 is the festival wristband that says which areas you may enter. OIDC is the photo badge that says who you are. Okta prints both, and scopes decide what is written on them.
3Meet Okta’s Authorization Servers
Okta does not have just one referee. It has two kinds, and they treat scopes differently.
The Org Authorization Server
Every Okta organization comes with a built-in authorization server called the Org Authorization Server. Its main job is to sign people into applications using OIDC and to protect Okta’s own management APIs. When you build a plain “sign in with Okta” experience and only need to know who the person is, the Org Authorization Server is often all you need.
A key limit to remember is that the access tokens minted by the Org Authorization Server are meant for Okta’s own APIs, such as the endpoint that returns user information and the management APIs. They are not meant to protect your own custom business APIs. Also, you cannot invent new scopes on it. You choose from a fixed menu that Okta provides.
Custom Authorization Servers
A custom authorization server is one you create and fully control. Okta also gives you one ready-made example called the default authorization server. Here you can define your own scopes, such as a permission to read orders or to approve invoices. You can attach claims, write access policies, set token lifetimes, and decide which clients may request which scopes. This is the right home for protecting your own APIs.
Custom authorization servers are typically part of Okta’s API Access Management capability, so you should confirm that it is included in your organization’s plan before designing around it.
| Question | Org Authorization Server | Custom Authorization Server |
|---|---|---|
| Main purpose | Sign-in and Okta’s own APIs | Protecting your own APIs and fine-grained control |
| Can you create new scopes? | No, you use the built-in set | Yes, as many as your design needs |
| Access tokens valid for | Okta APIs only | Your own resource servers |
| Policies and rules | Limited, mostly app-level settings | Full access policies with rules |
| Custom claims | Limited | Flexible and scope-aware |
| Typical use | Simple single sign-on | API security for products and platforms |
flowchart TD
A["Application needs tokens"] --> B{"What is the goal?"}
B -->|"Only sign people in"| C["Org Authorization Server"]
B -->|"Call Okta management APIs"| C
B -->|"Protect your own APIs"| D["Custom Authorization Server"]
C --> E["Fixed built-in scopes"]
D --> F["Built-in plus your own custom scopes"]
Teams sometimes try to use the Org Authorization Server to protect their own API and then wonder why the tokens are rejected or why they cannot add scopes. If the token is for your own API, you almost always want a custom authorization server.
4The Standard OIDC Scopes
The OpenID Connect specification defines a small family of scopes that every compliant provider understands, and Okta supports all of them.
openid
Switches on OIDC. It tells Okta this is a sign-in and returns an ID token with a stable subject identifier for the person.
profile
Asks for descriptive facts such as name, given name, family name, preferred username, locale, time zone, and last update time.
Asks for the email address and whether Okta has verified that address.
address
Asks for the postal address stored in the user’s profile.
phone
Asks for the phone number and whether it has been verified.
offline_access
Asks for a refresh token so the app can get new access tokens later without making the person sign in again.
Walking through them one by one
The openid scope is the foundation. Every OIDC request must include it. The ID token you receive always includes a subject value, which is the unique and unchanging identifier of the person inside Okta. Applications should treat that subject value as the true key for the person, because names and email addresses can change.
The profile scope is about how a person is described. The email scope is narrower and answers a very common need: how can I contact this person, and has the address been checked? The address and phone scopes are used less often, and because they touch more sensitive personal information, applications should only ask for them when there is a clear reason.
The offline_access scope behaves differently from the others. It does not reveal any facts about the person. Instead it changes how long the application can keep working, by allowing a refresh token to be issued. We give this scope its own chapter later.
How the standard scopes combine
Scopes are meant to be combined, and the order in which you list them does not matter. A typical web application asks for openid profile email and receives an ID token plus the matching facts. A mobile app that must stay signed in for weeks adds offline_access. A very small application that only needs to know that someone is signed in can ask for openid alone. The golden rule is that each extra word should be justified by a feature someone can point to, such as showing a name in the corner of the screen or sending a receipt to an email address.
It also helps to remember that a scope only opens the door to data that exists. If a person’s profile in Okta has no phone number, asking for the phone scope will not invent one. The claim will simply be missing, and the application should be written to cope gracefully with absent facts instead of assuming every value will arrive.
Picture a library card application form with separate tick boxes: one for your name, one for your email, one for your phone, one for your home address. You tick only what the library truly needs. The standard scopes are those tick boxes, and openid is the box that says “yes, this is a sign-up at all.”
Start every sign-in request with just openid. Add profile and email only if the application genuinely displays or uses those details. Add the rest only when a real feature needs them.
5Okta-Specific Scopes
Beyond the standard family, Okta adds a few scopes of its own for needs that OIDC does not cover.
groups
Asks Okta to include the person’s group memberships as a claim, so the app can make role-style decisions.
device_sso
Supports Native SSO, letting trusted apps on the same device share a sign-in through a device secret.
okta.* family
Permissions for Okta’s own management APIs, such as reading users, managing apps, or reading groups.
The groups scope
Many companies organise people into groups such as “Finance”, “Support Agents”, or “Administrators.” Applications often want to know these groups so they can show the right menus. The groups scope is how an application asks for that list. It will only work as expected when the groups claim has been configured, including a filter that says which groups should be included. On a custom authorization server, you create a claim of the groups type and tie it to this scope.
A word of caution: a person might belong to hundreds of groups, and putting all of them into a token can make the token large and slow. A good filter that sends only the groups the application actually cares about is both faster and safer.
The device_sso scope
Imagine a company with several mobile apps from the same family. A person signs into the first app and expects the others to simply recognise them. The device_sso scope supports that experience by returning a device secret that cooperating apps can use to get their own tokens without another full sign-in. It is a specialised tool for native-app single sign-on and is not needed in ordinary web applications.
The okta.* management scopes
These scopes have names beginning with okta. followed by the thing and the action, for example reading users or managing applications. They protect Okta’s own administrative APIs. They are granted to an application by an administrator, never by an ordinary end user clicking an approval button. Because they can change the identity system itself, they should be handed out with great care and always as narrowly as possible.
Granting a broad “manage” scope when a “read” scope would do the job. If an integration only needs to look up users, give it only the read permission. Management scopes should be rare and well documented.
6Scopes Versus Claims
Beginners often mix these two words up. They are partners, but they are not the same thing.
Two different ideas
A scope is a request for a category of access. A claim is a single fact about the person, delivered inside a token or from the user information endpoint. A scope usually unlocks a bundle of claims. For example, asking for the email scope leads to claims named email and email verified appearing. Asking for profile leads to claims such as name, given name, and family name.
A scope is like asking a waiter for “the breakfast menu.” A claim is each individual dish on that menu: the eggs, the toast, the juice. You ask for the menu once, and several dishes arrive.
graph LR
S1["Scope: openid"] --> C1["sub"]
S2["Scope: profile"] --> C2["name"]
S2 --> C3["given name"]
S2 --> C4["family name"]
S2 --> C5["locale"]
S3["Scope: email"] --> C6["email"]
S3 --> C7["email verified"]
S4["Scope: groups"] --> C8["groups"]
Where custom claims fit in
On a custom authorization server you can create your own claims, for example a department or an employee number, and decide when they appear. You can make a claim always appear, or appear only when a particular scope is requested. Tying a claim to a scope is a clean way to make sure sensitive facts are only released when the application has asked for them on purpose.
| Idea | What it is | Who decides it |
|---|---|---|
| Scope | A named request for a category of access | The client asks, Okta approves based on policy |
| Claim | One fact about the person or token | Okta fills it in from profile data and configuration |
| Audience | Which API the token is meant for | Set on the authorization server |
| Role or group | A label describing the person’s job or team | Managed in Okta and delivered as a claim |
7The Journey of a Scope: Request to Token
Follow a single scope from the moment an app asks for it until it appears in a token.
The app builds an authorization request
The application sends the person’s browser to Okta’s authorize endpoint. The request lists the scopes as one text value, with the words separated by spaces.
Okta identifies the client and the policy
Okta looks at which application is asking and which authorization server is involved, then finds the access policy that applies to that client.
The person signs in
If there is no active Okta session, the person is asked to prove who they are, perhaps with a password and a second factor.
Policy rules filter the scopes
Okta compares the requested scopes against the matching rule. Scopes that the rule does not allow are rejected or removed, depending on the situation.
Consent is checked
If a scope is marked as needing consent, the person sees a screen asking them to approve it. Scopes marked as implicit are granted without a prompt.
The app exchanges a code for tokens
Okta returns a short-lived code. The app swaps it, over a secure back channel, for an ID token and an access token that carry the approved scopes and claims.
sequenceDiagram
participant U as User
participant A as Application
participant O as Okta
participant R as Resource API
A->>O: Authorization request with scopes
O->>U: Sign in and consent if needed
U->>O: Approves
O->>A: Authorization code
A->>O: Exchange code for tokens
O->>A: ID token and access token
A->>R: Call API with access token
R->>R: Validate token and check scopes
R->>A: Response
What if only some scopes are granted?
Sometimes a person approves part of a request, or a policy allows some of the requested scopes but not others. Applications should never assume that everything they asked for was granted. The token response tells the application which scopes were actually issued, and the access token carries the final list in its scp claim. A well-built application checks that list and quietly turns off features whose scopes are missing, perhaps showing a gentle message that invites the person to grant more access when they want that feature.
This habit makes applications resilient. A profile page that cannot read a phone number can still show the name. A reporting screen that was denied the write scope can still display data in read-only mode.
For browser-based and mobile apps, the authorization code flow with a proof key (often called PKCE) is the recommended pattern. It protects the code in transit and works well alongside everything you learn in this guide about scopes.
8Creating Custom Scopes
On a custom authorization server you can invent scopes that describe your own business actions.
What goes into a custom scope
When an administrator creates a custom scope in Okta, they fill in a handful of simple fields. Each one has a purpose, and understanding them prevents many surprises.
Name
The exact word clients will send. Make it predictable, such as a resource name and an action joined together.
Display phrase
A short label shown to the person on a consent screen.
Description
A longer explanation for administrators and for consent text, in everyday language.
User consent
Either implicit, meaning no prompt, or required, meaning the person must approve it.
Default scope
If marked as default, the scope is granted when a client does not list any scopes at all.
Block services
Prevents machine-to-machine clients from requesting this scope, useful for scopes that only make sense when a human is present.
Public metadata
Controls whether the scope is listed in the server’s public discovery information.
Naming scopes well
A good scope name is like a good folder name: you can guess what is inside without opening it. A common convention is to name the thing and then the action, so one scope can mean “read orders” and another can mean “write orders.” Keep them small and focused. Avoid vague names such as “all” or “admin,” because vague names invite overly broad access and are hard to review later.
Designing scopes is like labelling the switches on a fuse box. If every switch just says “stuff,” nobody dares to touch them. If each one says “kitchen lights” or “garage sockets,” anybody can switch off exactly what they need without plunging the house into darkness.
Write the consent text first, as if you were explaining the permission to a non-technical friend. If you cannot explain it simply, the scope is probably too broad and should be split.
9Access Policies and Rules: The Gatekeepers
Creating a scope does not mean anyone can use it. Policies decide who gets which scopes.
Policies and rules
On a custom authorization server, an access policy is a container that is assigned to one or more client applications. Inside the policy live one or more rules, and Okta evaluates them in order, using the first rule that matches. A rule can look at which grant type the client is using, which user or group is signing in, and then decide which scopes are allowed. It can allow any scope, or only a named list of scopes.
Rules also control token lifetimes. You can set how long an access token lives, and how long a refresh token may live or remain unused. Short lifetimes for access tokens are a healthy default, because a stolen token then stops working quickly.
The effect on scopes
If a client asks for a scope that the matching rule does not allow, Okta will refuse the request and respond with an error saying the scope is invalid. This is why a scope can exist on the server yet still fail: the existence of a scope and the permission to use it are two separate things.
Because rules are checked from top to bottom and the first match wins, the order of rules matters a great deal. A common pattern is to place the most specific rule first, for example one that gives an administrators group extra scopes, and to put a broader rule for ordinary people below it. If the order is reversed, the broad rule matches first and the special rule is never reached, which is a classic cause of confusing behaviour. Reviewing rule order whenever a policy changes is a small habit that prevents big surprises.
flowchart TD
A["Client requests scopes"] --> B{"Policy assigned to this client?"}
B -->|"No"| X["Request denied"]
B -->|"Yes"| C{"A rule matches grant type and user?"}
C -->|"No"| X
C -->|"Yes"| D{"Scopes allowed by the rule?"}
D -->|"No"| X
D -->|"Yes"| E{"Consent required?"}
E -->|"Yes"| F["Show consent screen"]
E -->|"No"| G["Issue tokens"]
F -->|"Approved"| G
F -->|"Declined"| X
| Rule Condition | What It Controls | Why It Matters |
|---|---|---|
| Grant type | Which OAuth flows the rule applies to | Stops weak or unneeded flows from being used |
| User or group | Which people the rule applies to | Lets you give different scopes to different audiences |
| Scopes | Any scope, or only listed scopes | The main lever for least privilege |
| Token lifetimes | How long tokens remain valid | Limits the damage if a token leaks |
Choosing “any scopes” on every rule just to make errors disappear. That works, but it quietly removes the main safety net. Prefer an explicit list of the scopes each client truly needs.
10User Consent and Scope Approval
Sometimes the person must say yes before a scope is granted. Okta lets you choose when.
Why consent exists
Consent is the moment where the person is shown a clear list of what the application wants and chooses to allow it. It is most valuable when the application belongs to someone other than the company that owns the identity system, such as a partner or a third-party product. In that situation, the person deserves to know what they are sharing.
Implicit versus required
Okta lets you mark each custom scope as implicit or required. An implicit scope is granted with no screen. A required scope shows the display phrase and description on a consent page. For first-party applications that your own company builds and trusts, implicit consent is common because showing approval screens for your own internal tools can be annoying and adds little value. For third-party applications, required consent is usually the safer choice.
Applications can also be configured so that consent behaviour matches how much you trust them. A well-known internal portal might skip consent, while a partner integration always asks.
Remember too that a person who has approved a scope once may later change their mind. Good systems give people a way to review the applications they have approved and to take that approval away. When approval is withdrawn, the application should expect that future token requests may fail and should guide the person back through consent if they still want the feature.
First-party employee portal
The company’s own HR portal asks for sign-in and profile scopes. Because the company built it and every employee is already expected to use it, consent is implicit and people simply sign in.
Third-party analytics partner
A partner tool wants to read a customer’s order history. The scope for reading orders is marked as requiring consent, so the customer sees a clear screen and chooses whether to approve.
When you walk into your own home, nobody asks permission. When a delivery driver wants to enter your building lobby, you press a button to let them in. Implicit consent is your own front door; required consent is the buzzer for a visitor.
Consent screens are read by ordinary people. Use words like “View your order history” instead of technical phrases. Clear text builds trust and reduces the chance that people approve things they do not understand.
11Scopes in the ID Token, Access Token, and UserInfo
Approved scopes show up in different places depending on which token or endpoint you look at.
Three places to look
After a successful sign-in, an application may hold three different things that relate to scopes. The ID token describes the person. The access token carries the permissions for calling an API. The UserInfo endpoint is a service the app can call, using the access token, to fetch more facts about the person.
The ID token is meant for the client application. The client reads it to learn who just signed in. The access token is meant for the resource server, and the client should treat it as an opaque ticket rather than something to pick apart. The list of approved scopes appears inside the access token, in a claim named scp, and the resource server uses it to decide whether the call is permitted.
| Item | Who Reads It | What It Tells You |
|---|---|---|
| ID token | The client application | Who the person is and how they signed in |
| Access token | The resource server | Which actions the client may perform, via the scp claim |
| UserInfo response | The client application | Extra profile facts unlocked by approved scopes |
| Refresh token | Okta only | Permission to obtain a fresh access token later |
Where do the claims appear?
Which claims land directly in the ID token and which must be fetched from the UserInfo endpoint can depend on the type of authorization server, the response type used, and how each claim is configured. On a custom authorization server you can configure a claim to be included in the ID token always, or only when no access token is requested. Because details like this can vary with configuration and may change over time, always confirm the current behaviour in Okta’s official documentation when you design a production system.
Keep ID tokens small. If your app needs many profile facts, fetching them from UserInfo can keep the token light and the browser fast.
Sending the ID token to an API as if it were an access token. They have different audiences and different purposes. APIs should only accept access tokens issued for them.
12Refresh Tokens and offline_access
Access tokens are short-lived on purpose. Refresh tokens let apps keep working without constant sign-ins.
The problem refresh tokens solve
For safety, access tokens usually last only a short time, perhaps an hour or less. That is wonderful for security but would be terrible for convenience if the person had to sign in again each time a token expired. A refresh token solves this. It is a longer-lived credential that the application can quietly present to Okta to receive a brand-new access token.
What you must configure
To receive a refresh token, several things must line up. The application must request the offline_access scope. The application must be allowed to use the refresh token grant type. And, on a custom authorization server, the policy rule must permit the refresh token grant and the scope itself. If any one of these is missing, no refresh token will arrive, which is a very common source of confusion.
App requests offline_access
Included in the original sign-in request along with other scopes.
Okta returns a refresh token
Delivered alongside the access token if the application and policy allow it.
Access token expires
The short-lived access token reaches the end of its life.
App presents the refresh token
Okta checks it and issues a fresh access token without asking the person to sign in again.
An access token is a one-day pass to an amusement park. A refresh token is a membership card that lets you collect a new one-day pass each morning without queuing at the ticket office again. Because the membership card is valuable, you guard it much more carefully than the daily pass.
Refresh tokens are powerful. Store them only in safe places, prefer rotation so that each refresh token can be used once and is replaced, and set sensible limits on how long they may remain unused.
13Machines Talking to Machines
Not every request involves a person. Backend services also need scopes.
The client credentials flow
Sometimes there is no human at all. A nightly report job might need to call an internal API, or a provisioning tool might need to read user records from Okta. In these cases the application proves its own identity to Okta and receives an access token that represents the application itself, not any person. This pattern is called the client credentials flow.
Because no person is present, there is no sign-in, no ID token, and no consent screen. The openid scope is not used. What matters entirely is which custom scopes or Okta API scopes the application is allowed to request, and the policy that governs them.
Calling Okta’s management APIs
When a service needs to call Okta’s own APIs, it uses the okta-prefixed scopes from the Org Authorization Server. An administrator must explicitly grant each scope to the application. Okta also expects strong proof of the application’s identity, usually using a signed assertion built from a private key that only the application holds, rather than a simple shared password. In addition, the service is generally assigned an administrative role that limits what it can do, so scopes and roles work together as two locks on the same door.
sequenceDiagram
participant S as Backend Service
participant O as Okta
participant R as Protected API
S->>O: Prove identity and request scopes
O->>O: Check policy and allowed scopes
O->>S: Access token with scp claim
S->>R: Call API with token
R->>R: Verify signature, audience, scopes
R->>S: Data
Nightly user synchronisation
A scheduled job copies user records into a reporting system. It is given only a read scope for users, never a manage scope, so a mistake or a theft cannot alter any account.
Internal microservice calls
An order service calls an inventory service. Each service has its own client identity and its own narrow custom scope, so the order service can check stock but not change it.
Use the “block services” option on scopes that should only ever be used when a human is present, such as approving a payment, so a machine client can never request them.
14Security and Least Privilege
Scopes are a security tool, but only when they are designed and checked with care.
Principles to live by
The first principle is least privilege: every client receives only the scopes it needs today. The second is short lifetimes: access tokens expire quickly, so leaks do limited harm. The third is verification: a resource server must never trust a token blindly. It must check the signature, the issuer, the audience, the expiry time, and the scopes before it allows any action.
The fourth principle is that scopes are not a replacement for authorization inside your own system. A scope says the application is permitted to ask for a category of access. It does not say that this particular person is permitted to see this particular record. Your API still needs to check that the signed-in person owns or may view the data in question.
Thinking about lifetimes and revocation
Every token should answer the question “how long is it good for?” Access tokens work best when they live for minutes or an hour, because the shorter the life, the smaller the window an attacker has. Refresh tokens live longer, so they deserve extra protection and the option to be revoked. When an employee leaves or a device is lost, an administrator should be able to cut off the refresh tokens so that no new access tokens can be created, and the old access tokens simply fade away as they expire.
For very sensitive actions, such as moving money or changing security settings, teams often ask the person to sign in again or to complete another verification step, even if they already hold a valid token. Scopes alone do not provide this. It is an additional safeguard built into the sign-in policy and the application design.
Protecting personal information
Tokens travel through browsers, logs, and networks. Keep sensitive personal data out of access tokens, because they are often passed around and can end up in places you did not intend. Release sensitive facts through scopes that need consent, and prefer fetching them from UserInfo over embedding them everywhere.
Problem
A team must decide how broad each scope should be for a new orders API: one wide scope for everything, or separate scopes for reading and writing.
Why It Matters
A single wide scope is easy to build, but every client that receives it can change data, even clients that only need to display it. A leak or a bug then has a much larger impact.
Chosen Approach
Create separate read and write scopes. Give most clients only the read scope, and grant the write scope to a small number of carefully reviewed clients.
Treating a scope as proof that a person has a particular job. Scopes describe the application’s permissions, not the person’s role. Use groups, roles, or claims, together with checks in your API, for person-level decisions.
15Monitoring, Logging, and Troubleshooting
When a scope does not behave as expected, a calm, step-by-step investigation almost always finds the cause.
Where to look first
Okta keeps a System Log that records authentication and token activity, including failed requests. When a scope problem appears, the System Log should be your first stop because it shows which client asked, which policy matched, and why a request was refused. Good teams also watch trends: a sudden rise in refused scope requests can mean a mistaken deployment or an attempt to ask for more than a client should have.
The most common problems
| Symptom | Likely Cause | What To Check |
|---|---|---|
| Invalid scope error | Scope not allowed by the matching rule, or misspelled | Spelling, the rule’s scope list, the policy assigned to the client |
| No ID token returned | The openid scope was left out | The scope list in the authorization request |
| No refresh token returned | offline_access missing or refresh grant not allowed | The app grant types and the rule’s grant types |
| Groups claim missing or empty | Groups claim not configured or filter too narrow | Claim configuration and group filter |
| API rejects the token | Wrong audience or missing scope in the scp claim | Which authorization server issued it and the API’s expected audience |
| Consent screen not appearing | Scope set to implicit or app trusted | Scope consent setting and application consent option |
A calm checklist
Confirm the authorization server
Make sure the application is pointing at the server you expect, since the Org and custom servers behave differently.
Read the exact scope list sent
Check for typing errors, missing spaces between words, or an accidentally missing openid.
Review the policy and rule
Confirm the client is assigned to the policy and a rule matches its grant type and user.
Inspect the System Log
Look for the failed event and read the reason Okta recorded.
Decode and examine the tokens
Look at the scp claim and the audience in the access token to verify what was truly issued.
Track the number of refused scope requests per client, token issuance volume, and refresh activity. Unusual spikes are often the earliest sign of both bugs and abuse.
16Design Patterns and Anti-Patterns
Experienced teams repeat a few good habits and avoid a few tempting mistakes.
Patterns that work
Resource and action naming
Name scopes by the thing and the action so reviewers instantly understand each one.
One server per API family
Give related APIs their own authorization server and audience so tokens cannot be replayed against unrelated services.
Incremental permission
Ask for basic scopes at sign-in and request more only when a feature needs them, so people are never overwhelmed up front.
Scope-bound claims
Tie sensitive claims to specific scopes so they appear only when deliberately requested.
Anti-patterns to avoid
Problem
Creating one giant scope that means “everything” and giving it to every client.
Why It’s Harmful
Any compromise of any client exposes every capability. Reviews become impossible, because nobody can tell what a client actually needs.
Correct Approach
Split access into small, named scopes and grant each client only the ones it uses.
Problem
Requesting every available scope at sign-in “just in case” a feature might need it later.
Why It’s Harmful
It collects more personal data than needed, creates longer consent screens that people ignore, and enlarges the damage of any leak.
Correct Approach
Request the minimum at sign-in, then ask for additional scopes at the moment a feature actually requires them.
Problem
Using scopes as a stand-in for user roles, for example a scope that means “is a manager.”
Why It’s Harmful
Scopes describe what the application may do, not who the person is. Mixing the two leads to confusing rules and accidental over-permission.
Correct Approach
Use groups or roles for person-level decisions and keep scopes for application-level permissions, with checks inside your API for both.
Advantages of Fine-Grained Scopes
- Smaller blast radius if a token is stolen
- Clear, reviewable permissions for each client
- Better, friendlier consent screens
- Easier audits and compliance conversations
- Safer evolution as new features are added
Disadvantages / Trade-offs
- More scopes to design, document, and maintain
- Policies and rules become more detailed
- Developers must learn exactly which scope each call needs
- Too many tiny scopes can become confusing if names are not consistent
17Real-World Scenarios
Here are five everyday situations showing how scope decisions look in practice.
Scenario 1: A simple company intranet
An intranet only needs to know who is signed in and to greet them by name. It requests openid and profile through the Org Authorization Server, receives an ID token, and never touches any other data. Simple, safe, and enough.
Scenario 2: A retail mobile app
A shopping app signs customers in with openid, profile, and email, and also requests offline_access so shoppers stay signed in for weeks. Its calls to the company’s order API use custom scopes for reading and placing orders, issued by a custom authorization server.
Scenario 3: An internal admin dashboard
An administration tool needs to know which team each employee belongs to. It requests the groups scope with a tight filter that returns only the handful of groups the dashboard understands, keeping tokens compact and decisions accurate.
Scenario 4: A partner integration
An outside partner wants to show customers their invoices. The invoice-reading scope requires consent, is blocked from machine clients, and is limited by policy to the partner’s one application. Every approval is visible in the logs.
Scenario 5: An identity automation tool
A provisioning service creates and deactivates accounts as employees join and leave. It uses a service application with only the specific Okta management scopes it needs, proves its identity with a private key, and is assigned a narrow administrative role.
In every scenario the design starts with a single question: what is the smallest set of scopes that makes this feature work? Everything else follows from that habit.
You will also notice that none of these scenarios uses a magic setting. They all use the same small toolkit described in this guide: pick the correct authorization server, list the scopes honestly, let policies and consent act as gatekeepers, and let the resource server verify every token. The differences between a small intranet and a large partner platform are mostly a matter of how many scopes there are and how carefully each one is reviewed.
18A Practical Design Workflow
Here is a gentle, repeatable way to plan scopes before you touch a single setting.
List the capabilities
Write down every action your API or application can perform, in plain words, from the viewpoint of a user.
Group them into scopes
Combine closely related actions, but keep reading and changing separate. Aim for scopes you can describe in one friendly sentence.
Decide who may ask
For each client, list which scopes it truly needs, and note whether it acts for a person or for itself.
Choose consent behaviour
Mark sensitive scopes as requiring consent and consider blocking machine clients from human-only scopes.
Write the policies and rules
Translate the table of clients and scopes into access policies, with explicit scope lists and sensible token lifetimes.
Make the API enforce them
Ensure every resource server checks signature, issuer, audience, expiry, and the required scope on each call.
Test, monitor, and review
Test both success and refusal cases, watch the logs after release, and review scope grants on a regular schedule.
flowchart LR
A["List capabilities"] --> B["Group into scopes"]
B --> C["Map clients to scopes"]
C --> D["Set consent rules"]
D --> E["Write policies"]
E --> F["Enforce in the API"]
F --> G["Monitor and review"]
G --> B
Planning scopes is like planning a school timetable before the term starts. You decide which rooms exist, who may enter each, and when. Trying to work it out on the first morning, with children already in the corridors, is how chaos begins.
19Frequently Asked Questions
Quick answers to questions that beginners ask again and again.
Yes, if you want an OIDC sign-in and an ID token. Without it you are performing a plain OAuth 2.0 request, which gives you an access token but no identity information. The only common exception is a machine-to-machine request, where no person signs in at all.
The most frequent reasons are a misspelled scope, a scope that does not exist on the chosen authorization server, or a policy rule that does not allow that scope for this client. Check the spelling first, then the authorization server, then the rule.
No. Custom scopes belong on a custom authorization server. The Org Authorization Server offers a fixed set of built-in scopes.
A scope is a request for a category of access. A claim is an individual fact delivered in a token or from UserInfo. Approving a scope usually releases a group of claims.
Make sure the application asks for offline_access, that the application is permitted to use the refresh token grant, and that the policy rule on a custom server allows both the grant and the scope.
In the access token, inside the scp claim. The resource server reads this claim to decide whether to allow each call. Client applications should avoid depending on the internal structure of the access token.
No. It delivers the person’s group memberships as a claim. Your application can interpret groups as roles if you design it that way, but Okta treats it as a list of groups, and you remain responsible for deciding what each group means.
No. The scope tells you the application was permitted to ask for a category of access. Your API must also confirm the token is valid and meant for it, and must still check that this person is allowed to reach the specific data requested.
Require it for sensitive scopes and for applications that you do not own or fully control. For your own trusted internal applications, implicit consent usually gives a smoother experience without reducing safety in a meaningful way.
There is no magic number. Aim for scopes that are small enough to be meaningful and large enough to be manageable. If reviewers cannot remember what each scope does, or if you have dozens that are nearly identical, it is time to simplify.
20Summary and Key Takeaways
OIDC scopes in Okta are the clear, written permission slips that let applications ask for exactly the access they need. The standard scopes openid, profile, email, address, phone, and offline_access cover identity and session needs. Okta adds groups, device_sso, and the management family for specialised jobs. Custom authorization servers let you design your own scopes for your own APIs, while policies, rules, and consent settings decide who may receive them. Tokens then carry the approved result to the places that need it.
The craft lies in discipline: request little, grant little, verify everything, and keep the story simple enough that a newcomer can read it. If you remember the hotel key card from the beginning of this guide, you already hold the heart of the subject: a good key opens exactly the doors it should and no others.
Key Takeaways
- openid switches on sign-in — without it there is no ID token and no OIDC identity layer.
- Scopes request, claims answer — a scope names a category of access and releases a bundle of claims.
- Pick the right authorization server — use the Org server for sign-in and Okta APIs, and a custom server for your own APIs and custom scopes.
- Policies are the gatekeepers — a scope that exists still fails unless a matching rule allows it for that client.
- Least privilege always — request the minimum, split read from write, and prefer explicit scope lists over “any scope.”
- Scopes are not roles — use groups, claims, and checks in your API for decisions about specific people.
- Verify and monitor — validate signature, issuer, audience, expiry, and scope on every call, and watch the System Log for refused requests.