Repository navigation
[CP-768] fix(auth): device-code audience and callback iss - #224
Merged
Merged
Conversation
Auth0 does not apply the resource parameter on /oauth/device/code, so that request must use audience. The poll stays a plain device-code grant, backs off on slow_down, and the loopback callback checks iss when Auth0 sends it.
golangci-lint (testifylint go-require, wsl_v5) flagged the device-login test. A form parse error now returns 400 from the handler, which still fails the login. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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
Stacked on #219. The consent redirect does not need a CLI change:
--deviceonly polls, and the browser half of the device flow runs the same consent page. Two request details in #219 do not match that Auth0 behavior:POST /oauth/device/codenow sendsaudience(the discovered API identifier). Auth0's resource-parameter profile covers/authorizeand refresh, not the device-code endpoint, soresourcethere does not set the token audience.resource.slow_downadds five seconds to the interval (RFC 8628).access_denied(declined consent) andexpired_tokenstill stop the poll.isswhen Auth0 includes it. A missingissis still accepted.statestays the client's/authorizevalue.Test plan
go test ./internal/oauth/ ./internal/cmd/auth/qcloud auth login --devicereaches the consent page and the poll returns a token whoseaudis the generic API