Skip to content

Credential provider for OAuth jwt-bearer token exchange (e.g. Anthropic Workload Identity Federation) #115

Closed as not planned

Description

@thomasbarrett

Anthropic Workload Identity Federation exchanges an OIDC JWT at POST /v1/oauth/token (RFC 7523 jwt-bearer) for a short-lived Authorization: Bearer token. Actors have no JWT to exchange, and egress injection only supports static Secret values or a raw Actor JWT. The only option today is a long-lived API key.

Proposal

A token-exchange credential provider on credprovider.v1:

  • URI ate-secret://token-exchange/<namespace>/<name> names an exchange: token URL, extra form params (federation_rule_id, organization_id, service_account_id, …), and audience. It uses the same atespace→namespace grant as k8s.io.
  • The assertion is the provider's ServiceAccount token, from a fresh TokenRequest for every exchange (Anthropic rejects a reused jti).
  • Access tokens are cached and shared between concurrent fetches. A token is handed out only while it has comfortably more time left than the gateway's 5-minute credential cache, as in Mint Google access tokens in the Kubernetes credential provider #47.
  • Chart wiring through credentialProvider.additionalProviders (feat(helm): further credential providers for the egress gateway #90).

Questions

  • Should the default identity be the provider's ServiceAccount, or the calling Actor's JWT (MintActorJwt)? The latter lets the authorization server tell Actors apart. authz_util_test.go already lists a token-exchange identity with the egress-gateway role.
  • Should this provider live in this repo, or ship as a separate image? Mint Google access tokens in the Kubernetes credential provider #47 was closed without discussion.

kagent side: kagent-dev/kagent#3470. Happy to send the PR.

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

Metadata

Metadata

Assignees

No one assigned

    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