Feat: on behalf of token exchange support - #71
Merged
Conversation
kailash-b
approved these changes
Aug 17, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
actclaim and theorg_idclaim on validated tokens.What's added
Three accessors, on both the core
AuthenticationContextand the SpringAuth0AuthenticationToken: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. Returnsnullfor 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()- theorg_idclaim. Organization membership and RBAC are enforced by Auth0 at token issuance; the resource server simply reads the preserved value.Changes
auth0-api-java/.../models/AuthenticationContext.javaauth0-springboot-api/.../Auth0AuthenticationToken.javaauth0-api-java/.../models/AuthenticationContextTest.javaauth0-springboot-api/.../Auth0AuthenticationTokenTest.javaauth0-springboot-api/EXAMPLES.md,README.mdTest plan
AuthenticationContextTest: single actor, chained actors,org_idpresent/absent,actnot-a-map, missingsub, unmodifiable prior-actors listAuth0AuthenticationTokenTest: delegation of all three accessors