Skip to content

Add --resource flag for RFC 8707 Resource Indicators#152

Open
kevinmdb wants to merge 1 commit intoSecureAuthCorp:masterfrom
kevinmdb:feat/resource-indicators
Open

Add --resource flag for RFC 8707 Resource Indicators#152
kevinmdb wants to merge 1 commit intoSecureAuthCorp:masterfrom
kevinmdb:feat/resource-indicators

Conversation

@kevinmdb
Copy link
Copy Markdown

@kevinmdb kevinmdb commented May 8, 2026

Summary

Adds support for the OAuth 2.0 resource request parameter
(RFC 8707 — Resource Indicators)
to oauth2c. Mirrors the existing --audience plumbing.

  • New --resource flag (StringSlice, repeatable like --audience)
  • New Resource []string field on ClientConfig
  • Threads the value into the authorize, token, PAR, and device-authorization
    request bodies/queries
  • Multi-value handling uses repeated resource= parameters per RFC 8707
    §2 (rather than space-joining), so --resource A --resource B produces
    resource=A&resource=B
  • README flag table updated

Test plan

  • go test ./... passes (new unit tests in internal/oauth2/request_test.go
    cover empty / single / multiple resource values for both AuthorizeRequest
    and RequestToken)
  • go build ./... clean
  • golangci-lint run clean
  • Manually verified against an authorization-code + PKCE flow:
    --resource <uri> shows up in the GET to /authorize query params
    and the POST to /token form body

Adds support for the OAuth 2.0 `resource` request parameter (RFC 8707)
on the authorization, token, PAR, and device authorization endpoints.

Multiple resource indicators are sent as repeated `resource=` parameters
per the spec, rather than a single space-joined value.

Includes unit tests covering empty, single, and multi-value cases for
both AuthorizeRequest and RequestToken.
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.

1 participant