Skip to content

Use the called entity's identifier as client assertion audience (§8.8) - #212

Merged
zachmann merged 1 commit into
go-oidfed:mainfrom
topperge:fix/client-assertion-audience
Nov 12, 2026
Merged

zachmann merged 1 commit into
go-oidfed:mainfrom
topperge:fix/client-assertion-audience

Conversation

@topperge

Copy link
Copy Markdown
Contributor

Fixes #210.

The audience of a client authentication JWT is now the Entity Identifier of the entity whose federation endpoint is called, as OpenID Federation 1.1 §8.8 requires, instead of the endpoint URL:

  • fetch: the issuer whose fetch endpoint is called (issID of FetchEntityStatement(Ctx));
  • list: the authority whose list endpoint is called (fetchList / httpFetchList take its entity ID);
  • trust mark: c.TrustMarkIssuer in refreshExternal;
  • resolve: a new exported SimpleRemoteMetadataResolver.EntityID, set by SmartRemoteMetadataResolver.remoteResolverForTA to the trust anchor. A SimpleRemoteMetadataResolver built with only ResolveEndpoint still uses the URL as the audience.

httpFederationEndpointRequest(Ctx) takes the audience as a new parameter. The public API is otherwise unchanged.

Tests: clientauth_audience_test.go checks that fetch, list, trust mark and remote resolve each send aud = the called entity's ID, using endpoint URLs that differ from the entity IDs. clientauth_test.go is updated for the new parameter. The new tests fail on main and pass with this change; go test ./... passes.

I added the changelog entry under a new "Unreleased" heading; please move it wherever you prefer. #211 has a separate PR, and the two changelog entries will need a trivial merge.

🤖 Generated with Claude Code

https://claude.ai/code/session_01QYDqsx3UGxpCKvCiUxShZq

OpenID Federation 1.1 §8.8 requires the audience of a client
authentication JWT to be the Entity Identifier of the entity whose
federation endpoint is called, and the endpoint must not accept any
other audience. The library used the endpoint URL, so a compliant
endpoint rejected its authenticated fetch, list, trust mark and resolve
requests.

httpFederationEndpointRequest(Ctx) now takes the audience. Callers pass
the fetch issuer, the listing authority, or the trust mark issuer.
SimpleRemoteMetadataResolver gets an EntityID field, set by
SmartRemoteMetadataResolver to the trust anchor; without it the resolve
endpoint URL is still used.

Fixes go-oidfed#210

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QYDqsx3UGxpCKvCiUxShZq
@deepsource-io

deepsource-io Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

DeepSource Code Review

We reviewed changes in c889076...760fffc on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Code Review Summary

Analyzer Status Updated (UTC) Details
Go Nov 12, 2026 3:01a.m. Review ↗
Code coverage Nov 12, 2026 3:31a.m. Review ↗

Important

AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.

@zachmann
zachmann merged commit b721fbb into go-oidfed:main Nov 12, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants