Skip to content

feat(oauth): add login with the device authorization grant - #7245

Closed
pReya wants to merge 3 commits into
matrix-org:mainfrom
nordeck:feat/device-code-login
Closed

pReya wants to merge 3 commits into
matrix-org:mainfrom
nordeck:feat/device-code-login

Conversation

@pReya

@pReya pReya commented Oct 9, 2026 •

Copy link
Copy Markdown

EDIT: Sorry, premature PR.

pReya added 3 commits October 9, 2026 11:58
Add `OAuth::login_with_device_code()` to log in with the OAuth 2.0 device
authorization grant (RFC 8628), for clients that cannot open a browser,
such as bots, bridges and command-line applications. The spec sanctions
this grant as one of the two login flows of the OAuth 2.0 API.

The grant was already implemented for the QR code login, but kept
private and gated on the `e2e-encryption` feature. The two helpers are
now shared, `DeviceAuthorizationOAuthError` moved to the `error` module
with a re-export at its old path, and the new `LoginWithDeviceCode`
future exposes the verification URI and user code through a progress
stream before waiting for the user's approval and loading the session
like the other OAuth 2.0 logins.

Signed-off-by: Moritz Stückler <moritz@bitbetter.de>
Keep only the essential steps in the rustdoc example of
`OAuth::login_with_device_code()` and link to the `oauth_device_code`
example crate for a complete program.

Signed-off-by: Moritz Stückler <moritz@bitbetter.de>
Add the Nordeck copyright to the files created or significantly changed
for the device code login, below the existing holders.

Signed-off-by: Moritz Stückler <moritz@bitbetter.de>
@pReya
pReya requested a review from a team as a code owner October 9, 2026 10:35
@pReya
pReya requested review from poljar and removed request for a team October 9, 2026 10:35
@pReya pReya closed this Oct 9, 2026
@codecov

codecov Bot commented Oct 9, 2026

Copy link
Copy Markdown

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
3148 1 3147 0
View the top 1 failed test(s) by shortest run time
matrix-sdk-integration-testing::tests::timeline::test_toggling_reaction
Stack Traces | 3.48s run time
thread 'tests::timeline::test_toggling_reaction' (29848) panicked at .../src/tests/timeline.rs:198:9:
assertion failed: `(left == right)`'
  left: `"7"`
 right: `"3"`

Differences (-left|+right):
-7
+3


note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@codspeed

codspeed Bot commented Oct 9, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 50 untouched benchmarks


Comparing nordeck:feat/device-code-login (cdab354) with main (ff92e19)

Open in CodSpeed

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