Skip to content

Feat: on behalf of token exchange support - #71

Merged
tanya732 merged 2 commits into
mainfrom
feat/on-behalf-of-token-exchange-support
Aug 17, 2026
Merged

Feat: on behalf of token exchange support#71
tanya732 merged 2 commits into
mainfrom
feat/on-behalf-of-token-exchange-support

Conversation

@tanya732

Copy link
Copy Markdown
Contributor

Summary

Adds On-Behalf-Of (OBO) Token Exchange validation support to the Java resource-server SDK

As a resource-server SDK, this library validates tokens and does not act as an OAuth client, so it does not implement the token-exchange call (getTokenOnBehalfOf)

This PR exposes read-only accessors for the RFC 8693 act claim and the org_id claim on validated tokens.

What's added

Three accessors, on both the core AuthenticationContext and the Spring Auth0AuthenticationToken:

  • getActor() - the current actor (act.sub), i.e. the client that performed the exchange. Per RFC 8693 §4.1, this is the only actor to use for access-control decisions. Returns null for a direct (non-exchanged) token.
  • getPriorActors() - the delegation chain (nested actors), ordered most-recent → original. Informational only (audit/logging); MUST NOT be used for access control per RFC 8693 §4.1. Returns an empty list when there are none.
  • getOrganizationId() - the org_id claim. Organization membership and RBAC are enforced by Auth0 at token issuance; the resource server simply reads the preserved value.

Changes

Area File
Core accessors auth0-api-java/.../models/AuthenticationContext.java
Spring delegators auth0-springboot-api/.../Auth0AuthenticationToken.java
Core tests auth0-api-java/.../models/AuthenticationContextTest.java
Spring tests auth0-springboot-api/.../Auth0AuthenticationTokenTest.java
Docs auth0-springboot-api/EXAMPLES.md, README.md

Test plan

  • Core AuthenticationContextTest: single actor, chained actors, org_id present/absent, act not-a-map, missing sub, unmodifiable prior-actors list
  • Spring Auth0AuthenticationTokenTest: delegation of all three accessors
  • Full suite passes for both modules; no changes to existing behavior

@tanya732
tanya732 requested a review from a team as a code owner August 14, 2026 11:33
@tanya732
tanya732 merged commit efb3f09 into main Aug 17, 2026
6 checks passed
@tanya732 tanya732 mentioned this pull request Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants