Most engineers think…
Most people assume Okta is just a login page — enter username, get session, done. That model breaks the moment you need to protect your own APIs.
Okta API Access Management turns Okta into a token mint for your APIs: you define what a token means (scopes), what it says about the caller (claims), and who is allowed to request it under what conditions (access policy rules). The result is a signed JWT your resource server can verify without calling Okta on every request. Understanding that split between authorization server, scopes, claims and access policies is what separates an engineer who 'uses Okta' from one who can design an API security architecture.
① Authorization server model — Org AS vs Custom AS
Every Okta tenant ships with an Org Authorization Server — a fixed issuer at https://your-domain.okta.com/oauth2/v1 — that is designed exclusively for Okta's own APIs and admin scopes. You cannot add custom scopes or policies to it. For protecting your own APIs you need a Custom Authorization Server.
A Custom Authorization Server has its own issuer URI (e.g. https://your-domain.okta.com/oauth2/<id>), its own set of scopes, claims and access policies, and can have multiple audiences. You can create as many as your licence allows — one per API product, one per business unit, or one shared server with broad scopes. Okta also provides a built-in default Custom Authorization Server as a convenience starting point.
The interview line: if a question involves protecting your own API, the answer is always Custom Authorization Server, never the Org AS.
Rather than one giant authorization server with every scope, create one Custom Authorization Server per API product or business domain. This gives you independent access policies, cleaner token audiences, and lets teams own their own server without stepping on each other's scopes.
You need to protect an internal order management API with custom scopes. Which authorization server should you use?
② Scopes & claims — what a token says and permits
Scopes are the OAuth 2.0 mechanism for declaring what a token holder is allowed to do. You define scopes on the Custom Authorization Server (e.g. read:orders, write:invoices), the client requests them, and the access policy decides whether to grant them. Scopes appear in the scp array of the JWT; your API validates them before serving a resource.
Claims add information to the token. Standard OIDC claims (sub, email, groups) are built in. Custom claims are mapped from Okta user profile attributes, app assignments, group membership or Expression Language (EL) expressions. You can make a claim always include a value or tie it to a specific scope so it only appears when that scope is granted.
Access tokens vs ID tokens
Access tokens carry authorization for the resource server (scopes, custom claims, audience). ID tokens carry identity information for the client application (OIDC subject, name, email). Custom claims can be added to either — choose based on who consumes the token.
Your own OAuth 2.0 / OIDC issuer in Okta with a unique URI, custom scopes, claims and access policies — the foundation for protecting your APIs.
An OAuth 2.0 declaration of what the token holder may do. Defined on the auth server, requested by the client, granted by the access policy, and validated by the API.
A user-defined JWT field derived from Okta profile attributes, group membership, app assignments or an EL expression — added to access or ID tokens.
An Okta extension point that pauses token minting, calls your HTTPS endpoint with the draft payload, and merges your claim additions before signing the JWT.
ID tokens are for the client application to learn about the user — not for the API to make authorization decisions. Put scopes and permission claims in the access token and configure your resource server to validate that. Sending an ID token to an API instead of an access token is a common and dangerous design mistake.
Where does a custom claim derived from a user's department attribute appear?
③ Access policies — who gets what token under which conditions
An access policy is the set of rules that controls whether a client can obtain a token from a Custom Authorization Server, and what that token can contain. Each Custom Authorization Server has at least one access policy, and each policy has one or more rules evaluated in priority order.
Each rule specifies: which clients it applies to (all or specific app clients), which grant types are allowed (Authorization Code, Client Credentials, Refresh Token, etc.), which users or groups can consent (or no user for M2M), which scopes are permitted, and the token lifetimes — access token TTL, refresh token TTL and sliding window. If no rule matches, the request is denied.
The key design principle: least-privilege scoping per client. A rule for a microservice using Client Credentials might grant only read:inventory with a short access token TTL and no refresh token, while a web app rule grants broader scopes with a refresh token allowed. Both live in the same Custom Authorization Server but under different rules.
When an API call returns 401 or 403, decode the access token at jwt.io (or using your CLI) before assuming the API is misconfigured. Check the iss (issuer), aud (audience), scp (scopes) and exp (expiry) fields first. Nine times out of ten the token itself reveals the problem — wrong issuer, missing scope, or expired TTL.
▶ Watch a microservice get an access token end to end
A back-end service authenticates and calls a protected API. Press Play for the healthy path, then Break it to see the classic failure.
A microservice must call your inventory API. It should get only read:inventory and no refresh token. Where do you configure this?
④ Machine-to-machine tokens & token customization
The Client Credentials grant is the standard M2M flow: a back-end service authenticates directly with the Custom Authorization Server using its client_id and client_secret (or a private-key JWT for stronger assurance). No browser, no redirect, no user consent. Okta validates the credentials, evaluates the applicable access policy rule, and returns a signed access token with the requested scopes. The downstream API validates the JWT signature against Okta's JWKS endpoint.
Token customization
When built-in claims and Expression Language are not enough, Token Inline Hooks let you call an external HTTPS endpoint mid-minting. Okta pauses, sends the current token payload to your endpoint, and your service returns claim additions or modifications — for example, injecting a tenant ID fetched from an internal database. The hook response is merged into the token before signing. This is the escape hatch for anything EL cannot express.
Arjun at a Pune fintech faces this
A payment microservice starts receiving 401 errors from the invoicing API after a routine Okta policy change. Tokens look valid but the API rejects them.
The access policy rule for the payment service client was updated to allow only read:invoices, but the service was calling an endpoint that requires write:invoices — the scope is now absent from the minted token.
Decode the JWT at jwt.io — the scp array shows only read:invoices. The access policy rule was tightened and write:invoices was removed from the allowed scopes list for this client.
Okta Admin Console ▸ Security ▸ API ▸ Authorization Servers ▸ Access Policies ▸ RulesAdd write:invoices back to the allowed scopes in the rule for the payment service client, or create a separate rule with least-privilege scope for write operations. Confirm the client is requesting the scope in its token request.
Re-test: decode the new token — scp now includes write:invoices and the invoicing API returns 200.
A service needs a tenant ID injected into its access token but the value lives in your own database, not Okta. What is the right approach?
🤖 Ask the AI Tutor
Tap any question — instant, scoped to this lesson. No login, no waiting.
Pre-curated from vendor docs + community Q&A, scoped to this lesson. For a live prod issue, paste your export into chat.techclick.in.
📝 Wrap-up assessment — six more
You've answered 4 inline. Six left. 70% (7 of 10) marks the lesson complete on your profile. Tap Submit all answers at the end.
🧠 In your own words
Type one line: what is the job of a Custom Authorization Server, and how does an access policy rule control what ends up in a token? Then compare with the expert version.
🗣 Teach a friend
Best way to lock it in — explain it in one line to a teammate. Tap to generate a paste-ready summary.
📖 Glossary
- Custom Authorization Server
- An Okta-managed OAuth 2.0 / OIDC issuer you create with its own URI, scopes, claims and policies to protect your own APIs.
- Org Authorization Server
- Okta's built-in server at /oauth2/v1 for Okta admin APIs only — no custom scopes or policies allowed.
- Scope
- An OAuth 2.0 string in the scp array of an access token declaring what the holder is permitted to do on the API.
- Custom Claim
- A user-defined JWT field derived from Okta profile attributes, group membership, app assignments or Expression Language, added to access or ID tokens.
- Access Policy Rule
- A rule in a Custom Authorization Server that matches client, grant type, user, scopes and token TTLs — first match wins; no match means denial.
- Client Credentials Grant
- The OAuth 2.0 grant type for machine-to-machine flows — the service authenticates with its own credentials and receives an access token with no user or browser involved.
- Token Inline Hook
- An Okta extension point that pauses token minting, calls your external HTTPS endpoint with the draft JWT payload, and merges claim additions before signing.
- JWKS Endpoint
- The JSON Web Key Set URL published by a Custom Authorization Server — resource servers fetch public keys here to verify JWT signatures locally without calling Okta per request.
- Expression Language (EL)
- Okta's embedded scripting syntax for deriving custom claim values from user profile attributes, group membership and app context without external calls.
📚 Sources
- Okta Developer — API Access Management concepts. developer.okta.com/docs/concepts/api-access-management/
- Okta Developer — Authorization servers: Org AS vs Custom AS. developer.okta.com/docs/concepts/auth-servers/
- Okta Developer — OAuth 2.0 claims and scopes. developer.okta.com/docs/concepts/oauth-claims/
- Okta Developer — Configure an access policy. developer.okta.com/docs/guides/configure-access-policy/main/
- Okta Developer — Implement the Client Credentials grant. developer.okta.com/docs/guides/implement-grant-type/clientcreds/main/
- Okta Developer — Token Inline Hooks. developer.okta.com/docs/reference/token-hook/
What's next?
Got the authorization server model? Next, go deep on Okta Workflows and the Event Hook system — how to trigger external logic from every Okta lifecycle event without writing a custom integration.