Skip to content

Pluggable actor-token validation at ID-JAG issuance #6899

Closed

Description

@jhrozek

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_token is required when issuing an ID-JAG from a grant. The actor_token_type is pinned in that configuration.
  • The authorization server passes the validator the actor_token, the client, and the grant's user: sub and sub_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 as act.sub. For example, Mecatl's validator checks that the agent's session belongs to the user named by sub_id.
  • Refusals: invalid_request with reason svid_expired (credential expired) or denied (any other refusal, including an agent that may not act for this user).
  • act in the ID-JAG is single-level: act.iss is this server's issuer, and act.sub is 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.sub produced.
  • 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.Config field maps validator names to implementations, following the embedder-hook conventions of RefreshGrantHandlers (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_profile setting. 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) becomes invalid_request (RFC 8693 §2.2.2) with its reason code. Any other error, a timeout, or a result without AgentID or with a zero or past ExpiresAt becomes server_error. Nothing falls back to another check.
  • The validator never sets claims: this server builds act from AgentID, and refuses a subject token that already carries act.

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_token is refused for a configured client;
  • deny and expiry produce their reasons;
  • the validator receives the grant's sub and sub_id (the parent's for a child grant), whatever the request says;
  • an ID-JAG carries the returned identifier in act.sub and expires no later than the actor credential.

Activity

  1. changed the title [-]Agent identity at ID-JAG issuance (JWT-SVID actor tokens)[/-] [+]Pluggable actor-token validation at ID-JAG issuance[/+] on Oct 21, 2026
  2. removed
    needs-triageIssue needs initial triage by a maintainer
    on Nov 4, 2026
  3. self-assigned this
    on Nov 4, 2026
  4. jhrozek commented on Nov 16, 2026

    @jhrozek
    ContributorAuthor

    The actor validator for ID-JAG issuance is in main. The pieces that landed:

    • Clients with an actor profile must send an actor token. The check is in #7144.
    • The validator runs as the last check before minting. Denials and expiry map to their reasons, and it receives the grant's sub and sub_id. See #7147.
    • The ID-JAG names the agent in act, its iat is taken after the validator call, and its exp is capped at the actor credential's expiry. See #7149.
    • The docs describe the whole check. See #7152.

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions