Repository navigation
Description
Part of #6886. Depends on #6898.
Problem: the ID-JAG should name the agent acting for the user. Before putting act in the token, the authorization server must confirm three things: the agent's credential is real, the agent may act for the user of the grant being exchanged, and which opaque identifier names it. The authorization server knows grants and users, not the client's sessions, so the client decides what "may act for this user" means. How to confirm that depends on the deployment: a client may run its own agent registry next to the authorization server, or may give agents signed credentials the server can verify on its own.
Change: a pluggable actor-token validator.
- For a client configured with an actor profile,
actor_tokenis required when issuing an ID-JAG from a grant. Theactor_token_typeis pinned in that configuration. - The authorization server passes the validator the
actor_token, the client, and the grant's user:subandsub_id, both from the stored grant (child grants carry their parent's). The validator returns allow or deny, a reason, and the opaque agent identifier to use asact.sub. For example, Mecatl's validator checks that the agent's session belongs to the user named bysub_id. - Refusals:
invalid_requestwith reasonsvid_expired(credential expired) ordenied(any other refusal, including an agent that may not act for this user). actin the ID-JAG is single-level:act.issis this server's issuer, andact.subis the identifier the validator returned. Its format is checked.- ID-JAG expiry is capped at the actor credential's expiry, as the validator reports it, and at a configured maximum.
- Audit records the validator's input identity next to the
act.subproduced. - The hook (interface, configuration, registration, and error mapping) does not depend on ID-JAG issuance and can be built first; the call is wired into the issuance path of ID-JAG issuance through token exchange #6898.
- Embedders register an implementation in process. For example, Mecatl's implementation asks its identity broker, which holds the agent registry and runs in the same process as the authorization server.
Interface sketch (package tokenexchange; names illustrative):
type ActorTokenValidator interface {
ValidateActor(ctx context.Context, req ActorRequest) (ActorResult, error)
}
type ActorRequest struct {
ActorToken string // raw actor_token; never logged
ActorTokenType string // as presented, checked against the profile's pinned type
ClientID string // the authenticated client
Grant GrantOwner // from the stored grant, never from request input
}
type GrantOwner struct {
Subject string // the grant's sub
SubjectIdentifier string // the grant's sub_id (RFC 9493 JSON), empty if absent
}
type ActorResult struct {
AgentID string // opaque; becomes act.sub
ExpiresAt time.Time // actor credential expiry; caps the ID-JAG's exp
CredentialSubject string // identity the validator authenticated (for example a SPIFFE ID), for audit
}
// A refusal is an error wrapping *ActorDeniedError{Reason: svid_expired | denied}.Registration and selection:
- A Go-only
authserver.Configfield maps validator names to implementations, following the embedder-hook conventions ofRefreshGrantHandlers(Let embedders refuse refresh grants on dead upstreams #6902): set by embedders in process, nil entries rejected at startup, no global registry. - A pre-provisioned client names its validator with an
actor_profilesetting. An unknown name fails startup. Dynamically registered clients cannot carry a profile. - For a client with a profile, this replaces today's self-issued-only actor check (
resolveActorIdentity,tokenexchange/handler.go). Clients without a profile keep the current behaviour. - Deployments configured only through the operator get built-in validators only, selected by name. No webhook validator for now: a remote endpoint would effectively decide agent identity and sit on the token endpoint's availability path.
Call and error mapping:
- Called only after client authentication and validation of the grant (including its parent), and before any token is issued; a fixed timeout (5 s); no caching of decisions.
- A refusal (
*ActorDeniedError) becomesinvalid_request(RFC 8693 §2.2.2) with its reason code. Any other error, a timeout, or a result withoutAgentIDor with a zero or pastExpiresAtbecomesserver_error. Nothing falls back to another check. - The validator never sets claims: this server builds
actfromAgentID, and refuses a subject token that already carriesact.
Why typed rather than a raw fosite handler like #6902: the hook must return the actor identifier, and it needs the grant's user from this server's own storage. A validation-only fosite handler can provide neither.
Later, a second implementation: a built-in JWT-SVID validator (trust domain per client, bundle via #6201, aud equal to this server's issuer, lifetime limits, sub path prefix, an owner claim compared with the grant's sub_id, an agent identifier signed into the SVID), for deployments where the authorization server must verify agents without the client's registry. It depends on #6199's SVID validation work and is listed under "Later" in #6886.
Acceptance: with a test validator:
- an exchange without
actor_tokenis refused for a configured client; - deny and expiry produce their reasons;
- the validator receives the grant's
subandsub_id(the parent's for a child grant), whatever the request says; - an ID-JAG carries the returned identifier in
act.suband expires no later than the actor credential.
Activity
[-]Agent identity at ID-JAG issuance (JWT-SVID actor tokens)[/-][+]Pluggable actor-token validation at ID-JAG issuance[/+]docs(agent-identity): specify delegated access to provider credentials
docs(agent-identity): specify delegated access to provider credentials
docs(agent-identity): specify delegated access to provider credentials
docs(agent-identity): specify delegated access to provider credentials
docs(agent-identity): specify delegated access to provider credentials
jhrozek commentedon Nov 16, 2026
The actor validator for ID-JAG issuance is in main. The pieces that landed:
subandsub_id. See #7147.act, itsiatis taken after the validator call, and itsexpis capped at the actor credential's expiry. See #7149.Audit records of the validator's input identity were postponed and are not part of this issue's closure. They need their own issue if still wanted.