Skip to content

[CP-768] fix(auth): device-code audience and callback iss - #224

Merged
Robert-Stam merged 2 commits into
feat/oauth-auth-loginfrom
feat/oauth-device-audience
Oct 19, 2026
Merged

Robert-Stam merged 2 commits into
feat/oauth-auth-loginfrom
feat/oauth-device-audience

Conversation

@qdrant-cloud-bot

Copy link
Copy Markdown
Contributor

Summary

Stacked on #219. The consent redirect does not need a CLI change: --device only 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/code now sends audience (the discovered API identifier). Auth0's resource-parameter profile covers /authorize and refresh, not the device-code endpoint, so resource there does not set the token audience.
  • The token poll no longer sends resource. slow_down adds five seconds to the interval (RFC 8628). access_denied (declined consent) and expired_token still stop the poll.
  • The loopback callback checks RFC 9207 iss when Auth0 includes it. A missing iss is still accepted. state stays the client's /authorize value.

Test plan

  • go test ./internal/oauth/ ./internal/cmd/auth/
  • After the CLI Auth0 app exists: qcloud auth login --device reaches the consent page and the poll returns a token whose aud is the generic API

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.
@qdrant-cloud-bot
qdrant-cloud-bot requested a review from a team as a code owner October 18, 2026 21:16
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>
@Robert-Stam
Robert-Stam merged commit e4e3217 into feat/oauth-auth-login Oct 19, 2026
5 checks passed
@Robert-Stam
Robert-Stam deleted the feat/oauth-device-audience branch October 19, 2026 09:04
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