Skip to content

feat: token exchange endpoint and documentation - #258

Merged
oej merged 3 commits into
CycloneDX:mainfrom
relizaio:2026-08-token-auth-endpoint
Sep 9, 2026
Merged

oej merged 3 commits into
CycloneDX:mainfrom
relizaio:2026-08-token-auth-endpoint

Conversation

@taleodor

Copy link
Copy Markdown
Contributor

Implements /token endpoint and corresponding documentation. The endpoint is not required for an open (no-auth TEA server), but if auth is present, the /token endpoint is required. If /token endpoint is used, at least HTTP Basic authentication must be supported, while there are other options.

Signed-off-by: Pavel Shukhman <pavel@reliza.io>
@taleodor
taleodor requested review from madpah and oej as code owners August 26, 2026 01:17

@oej oej left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work, just some smaller questions

Comment thread auth/readme.md Outdated
Comment thread auth/readme.md
@oej

oej commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

If a client connects to a server that has no "/token" endpoint and no auth - will it receive a 404 which feels weird.

i would like that every TEA service has /token endpoint and if no auth is in play, simply return "200 ok"

…n endpoint

Follow-up to @oej's review of CycloneDX#258.

- The token endpoint section referred to the OpenAPI file by a relative
  repository link, which will not survive extraction into the ECMA
  document. It now refers to the TEA OpenAPI specification by name.
- The `invalid_token` retry rule did not say where the error code lives.
  It is the `error` attribute of the `WWW-Authenticate: Bearer` challenge
  header on the 401 response (RFC 6750 section 3), not part of the token,
  which stays opaque. The sentence names the header and shows it.
- The Discovery section is replaced by a Client flow section giving the
  complete sequence: try the resource without credentials; 200 means
  open; 401 with a Bearer challenge means obtain a token from /token and
  repeat with the bearer token; on invalid_token, refresh and retry once.
  A client holding an API key may go to the token endpoint directly.
  Clients shall not probe /token to discover authentication, and shall
  not send the API key to resource endpoints.
- New Servers without authentication section: such a server need not
  implement /token (a token response must carry a token and the
  mandatory grant requires client authentication, so it could only issue
  a meaningless one), shall not answer 401, and shall ignore rather than
  reject a bearer token presented anyway.
- New Mixed servers section: a server with any protected endpoint is a
  server that requires authentication and implements the baseline in
  full; open endpoints behave as on an open server; protected endpoints
  challenge per endpoint; authorization of protected data stays the
  server's decision.
- Protected resource metadata (RFC 9728) kept as an optional subsection,
  stated not to replace the challenge as the discovery mechanism.
- Scope section points at the two new sections.
- Spec: the /token description says a server that requires authentication
  on any endpoint implements it, an open server need not, and clients do
  not probe it; a 404 means only "not implemented".

Validated with openapi-generator v7.12.0 (pre-existing unused-model
warning only). All intra-document anchors resolve.

Signed-off-by: Claude Code (ReARM Agent) <rearm-agent-claude@reliza.io>
Token endpoint: client flow, open and mixed servers, review follow-ups

Signed-off-by: Pavel Shukhman <taleodor@users.noreply.github.com>
@taleodor

taleodor commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

If a client connects to a server that has no "/token" endpoint and no auth - will it receive a 404 which feels weird.

i would like that every TEA service has /token endpoint and if no auth is in play, simply return "200 ok"

@oej Clarified this in follow up commit. Essentially, client never starts with accessing token endpoint, it only does so if receives 401 prior. So client shouldn't be probing /token.

@oej oej left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved in meeting

@oej
oej merged commit 7c31a71 into CycloneDX:main Sep 9, 2026
2 checks passed
@oej oej mentioned this pull request Sep 12, 2026
oej pushed a commit that referenced this pull request Sep 14, 2026
Mark token exchange as outside the interoperable profile and remove
the incomplete subject_token fields. Keeps the client_credentials
baseline from #258, and narrows its token-exchange mention to an
optional future extension pending a concrete consumer.

Closes #273.

Signed-off-by: Mehrn0ush <mehrnoush.vaseghi@gmail.com>
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