Skip to content

Bind JWT-bearer resource to the assertion claim - #7091

Closed
kanywst wants to merge 1 commit into
stacklok:mainfrom
kanywst:idjag-resource-claim
Closed

kanywst wants to merge 1 commit into
stacklok:mainfrom
kanywst:idjag-resource-claim

Conversation

@kanywst

@kanywst kanywst commented Nov 9, 2026

Copy link
Copy Markdown

Summary

  • A JWT-bearer redemption checked resource only against the subject binding, so an ID-JAG issued for one resource could be redeemed for another one the binding allowed. It also required resource, which Okta's redemption request leaves out.
  • When the assertion has a resource claim, the requested resource must be one of its values (invalid_target otherwise). Without the parameter, a string claim is used; an array claim or no claim is refused with invalid_request. A malformed claim is invalid_grant.
  • There is no per-client default resource in the code today, so the no-claim case refuses.

Ref #6892. Not Fixes, since this wasn't tested against a real Okta-issued ID-JAG.

Type of change

  • Bug fix

Test plan

  • Unit tests (go test ./pkg/authserver/...)
  • Linting (golangci-lint run ./...)

Does this introduce a user-facing change?

Yes. A redemption without resource works when the ID-JAG has a string resource claim, and a resource that is not in the claim is refused with invalid_target.

A JWT-bearer redemption checked the requested resource only against the
subject binding, so an ID-JAG issued for one resource could be redeemed
for any other resource the binding allowed. The request also had to
carry a resource parameter, which Okta's documented redemption request
omits.

When the assertion carries a resource claim, the requested resource must
be one of its values, or the grant fails with invalid_target. Without
the parameter, a string claim is used; an array claim, or no claim, is
refused with invalid_request. A malformed claim is invalid_grant.

Ref: stacklok#6892
Signed-off-by: kanywst <45947799+kanywst@users.noreply.github.com>
@jhrozek

jhrozek commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

Thanks for looking into this. We're going to close this one, for two reasons.

First, #6892 wasn't claimed. CONTRIBUTING.md asks contributors to comment on an issue and wait to be assigned before starting work ("Claiming an issue"), so we don't end up with two implementations of the same thing.

Second, the change goes into validateJWTBearerPolicy, which the plain RFC 7523 handler shares with the ID-JAG one, so it would give a resource claim meaning on plain JWT-bearer assertions too. It also refuses requests that succeed today, and ID-JAG redemption has shipped, so we want to roll that out more gradually.

We'll handle #6892 ourselves, building on #7103.

@jhrozek jhrozek closed this Nov 11, 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