NHI / Machine-to-Machine Demo

This page walks through OAuth 2.0 Client Credentials against Okta — the flow for headless agents, CI/regression jobs, and service-to-service calls with zero human authentication anywhere in the chain. Edit the fields on the left, then run each step on the right in order.

Configuration

What each piece is for

Authorization Server
Okta object that mints tokens and enforces which client can request which scope, via its access policy + rule.
Access Policy / Rule
Not shown here as a field, but it's what actually grants this Client ID the right to request this Scope with this Grant Type. Configured once in Okta admin, not per-call.
Resource Server
The API being protected (this same box, in this demo) — it independently validates the token's signature, issuer, audience, and scope before doing anything. Okta doesn't do this validation on the resource's behalf.
human_user_involved: false
The field the resource returns to prove no person authenticated anywhere in this chain.

1Call the resource with no token

not run

Proves the endpoint is actually protected before we do anything else.

2Request a token from Okta

not run

Backend does POST https://{Okta Domain}/oauth2/{AS ID}/v1/token with grant_type=client_credentials and scope=..., authenticated with Basic auth (Client ID:Secret, Base64-encoded). No browser, no login page, no human — this call is entirely agent-to-Okta. The response's scp, aud, and sub claims below confirm the client — not a person — is the identity in the token.

3Call the resource WITH the token

not run

Same call as step 1, now carrying Authorization: Bearer <token>. The resource validates it independently and, if valid, executes the action.