An agent presents an Okta token that says it belongs to the platform group, and that single fact opens every database, cluster, and host the group can reach, for as long as the token lives. That is the over-scoped default, and just-in-time access is what replaces it with a grant sized to one task. The token still proves who the agent is. It should not also decide, by itself, everything the agent may touch.
The way to get just-in-time access right here is to treat the Okta token as the input to an authorization decision, not the authorization itself, and to scope every grant down to a single connection. Okta is the identity provider. The agent authenticates against Okta, Okta issues the token, and the access gateway verifies that token and reads the group membership to decide whether one specific connection to infrastructure is allowed right now.
Configuring just-in-time access for least scope
Least scope is the whole game. A grant that maps an Okta group to broad standing reach is just-in-time in name only. Configure it the other way around, from the connection up:
- Authenticate the agent against Okta. The agent signs in as a distinct identity, and Okta issues a token carrying that identity and its group claims. No infrastructure credential is involved at this step.
- Verify the token at the gateway. The access gateway acts as the OIDC relying party. It validates the token's signature and issuer, then reads identity and group membership. The gateway does not call Okta's admin API or stand in front of it. It consumes the token Okta already issued.
- Map groups to connections, not to estates. Bind an Okta group to a named connection, for example a single read replica or one Kubernetes namespace, rather than to a whole environment. The narrower the mapping, the smaller the grant a valid token can produce.
- Issue a short-lived grant for the requested connection. When the agent asks for that connection, the gateway issues a grant scoped to it that expires in minutes. The agent never holds the database password, the SSH key, or the kubeconfig.
- Record the request, the decision, and the expiry on the gateway side, where the agent has no write path.
The result is that an Okta token, even one with a generous group, can only ever be exchanged for the single expiring connection the policy allows. Group membership decides eligibility. The grant decides reach, and the grant is small.
Why the boundary has to sit outside the agent
The reason this needs an external layer is the same reason just-in-time access exists at all. If the agent verifies its own token and grants itself the connection, a compromised agent can widen the scope and edit the record of what it did. The token verification and the grant have to be issued by something the agent cannot reconfigure.
