WIP: Draft: Resolve "[OIDC] Device Code Grant Flow" #3593

Draft
magicfelix wants to merge 10 commits from 1065-oidc-device-code-grant-flow into master
Member

Information and screenshots

Screenshot_20260115_212701

Screenshot_20260115_212715

Screenshot_20260115_212726

Checklist

  • tox -e reformat,lint used
  • Changelog updated/No update necessary
  • Documentation (incl. Screenshots) up-to-date
  • Copyright in apps.py and README.rst up-to-date
  • (Unit) tests for new feature/regression tests for bug fixes (only if useful)
  • Adhere to URL scheme
  • Tested with admin account
  • Tested with normal account (based on permissions)

Backend checklist

  • Use permissions for all GraphQL mutations
  • Use query optimizer for all GraphQL queries
  • Don't use inefficient DB queries

Frontend checklist (mandatory with ~"part::frontend")

Closes #1065

## Information and screenshots ![Screenshot_20260115_212701](/uploads/c2381e7f9c7d0fbded174e1952f9e7b6/Screenshot_20260115_212701.png) ![Screenshot_20260115_212715](/uploads/041f2a8633a6e3d668fc96871a5b2fe1/Screenshot_20260115_212715.png) ![Screenshot_20260115_212726](/uploads/8150dfeeb780ffbd9e2fcc238a339e24/Screenshot_20260115_212726.png) ## Checklist - [x] `tox -e reformat,lint` used - [x] Changelog updated/No update necessary - [ ] Documentation (incl. Screenshots) up-to-date - [ ] Copyright in `apps.py` and `README.rst` up-to-date - [ ] (Unit) tests for new feature/regression tests for bug fixes (only if useful) - [ ] Adhere to [URL scheme](https://edugit.org/AlekSIS/official/AlekSIS/-/issues/86) - [x] Tested with admin account - [ ] Tested with normal account (based on permissions) ## Backend checklist - [ ] Use permissions for all GraphQL mutations - [ ] Use query optimizer for all GraphQL queries - [ ] Don't use inefficient DB queries ## Frontend checklist (mandatory with ~"part::frontend") - [ ] Screenshots are attached (mobile and desktop) - [ ] Tested on mobile, tablet, and desktop sizes - [ ] Adhered to [frontend guidelines](https://edugit.org/AlekSIS/official/AlekSIS/-/blob/master/project/frontend_guidelines.rst?ref_type=heads) - [ ] Checked with [Firefox Accessibility Checker](https://firefox-source-docs.mozilla.org/devtools-user/accessibility_inspector/) Closes #1065
Author
Member

added 1 commit

  • 14f9e657 - Add migration for device grant

Compare with previous version

added 1 commit <ul><li>14f9e657 - Add migration for device grant</li></ul> [Compare with previous version](/AlekSIS/official/AlekSIS-Core/-/merge_requests/1948/diffs?diff_id=71720&start_sha=9634a3f275a544dd363702d24b41469f526de800)
Author
Member

added 1 commit

  • 41282e7a - Add migration for device grant

Compare with previous version

added 1 commit <ul><li>41282e7a - Add migration for device grant</li></ul> [Compare with previous version](/AlekSIS/official/AlekSIS-Core/-/merge_requests/1948/diffs?diff_id=71724&start_sha=14f9e6575531ef80917b8c71ee10c74720aa7cfa)
Author
Member

added 1 commit

  • ff02ae4a - Add template for user code form

Compare with previous version

added 1 commit <ul><li>ff02ae4a - Add template for user code form</li></ul> [Compare with previous version](/AlekSIS/official/AlekSIS-Core/-/merge_requests/1948/diffs?diff_id=71734&start_sha=41282e7aab5e7e9c22040098436e7116f6491230)
Author
Member

added 341 commits

  • ff02ae4a...0d3dc8ac - 337 commits from branch master
  • e131fae4 - Add migration for device grant
  • af41a6da - Add template for user code form
  • e645ad6f - Fix migration history
  • 014727ae - WIP

Compare with previous version

added 341 commits <ul><li>ff02ae4a...0d3dc8ac - 337 commits from branch <code>master</code></li><li>e131fae4 - Add migration for device grant</li><li>af41a6da - Add template for user code form</li><li>e645ad6f - Fix migration history</li><li>014727ae - WIP</li></ul> [Compare with previous version](/AlekSIS/official/AlekSIS-Core/-/merge_requests/1948/diffs?diff_id=78985&start_sha=ff02ae4ae2f316cbfb7fccc6bc0f94265ff9d28a)
Author
Member

added 546 commits

  • 014727ae...9a8a6f51 - 544 commits from branch master
  • b999a3f2 - Add template for user code form
  • 5532262b - WIP

Compare with previous version

added 546 commits <ul><li>014727ae...9a8a6f51 - 544 commits from branch <code>master</code></li><li>b999a3f2 - Add template for user code form</li><li>5532262b - WIP</li></ul> [Compare with previous version](/AlekSIS/official/AlekSIS-Core/-/merge_requests/1948/diffs?diff_id=81556&start_sha=014727aec9a253f185523cd94d47a4e97b83829e)
Author
Member

added 3 commits

  • f5ced237 - Add accept deny template for device grant
  • 7db5c38b - Add template for device grant status
  • 1662b31a - Update changelog

Compare with previous version

added 3 commits <ul><li>f5ced237 - Add accept deny template for device grant</li><li>7db5c38b - Add template for device grant status</li><li>1662b31a - Update changelog</li></ul> [Compare with previous version](/AlekSIS/official/AlekSIS-Core/-/merge_requests/1948/diffs?diff_id=81791&start_sha=5532262b691f35f0385306218dad12fd98ffe86e)
Author
Member
Needs: https://github.com/django-oauth/django-oauth-toolkit/pull/1643
Author
Member

marked the checklist item tox -e reformat,lint used as completed

marked the checklist item **`tox -e reformat,lint` used** as completed
Author
Member

marked the checklist item Changelog updated/No update necessary as completed

marked the checklist item **Changelog updated/No update necessary** as completed
Author
Member

marked the checklist item Tested with admin account as completed

marked the checklist item **Tested with admin account** as completed
Author
Member

added 136 commits

  • 1662b31a...958627e4 - 132 commits from branch master
  • 1d1f7af3 - Add template for user code form
  • 37c0c706 - Add accept deny template for device grant
  • 256f11ec - Add template for device grant status
  • 8034f228 - Update changelog

Compare with previous version

added 136 commits <ul><li>1662b31a...958627e4 - 132 commits from branch <code>master</code></li><li>1d1f7af3 - Add template for user code form</li><li>37c0c706 - Add accept deny template for device grant</li><li>256f11ec - Add template for device grant status</li><li>8034f228 - Update changelog</li></ul> [Compare with previous version](/AlekSIS/official/AlekSIS-Core/-/merge_requests/1948/diffs?diff_id=82849&start_sha=1662b31ab806cafe93d501c83fb23a1163cbf589)
Author
Member

added 219 commits

  • 8034f228...afcbde33 - 215 commits from branch master
  • d0e645c8 - Add template for user code form
  • 137b3446 - Add accept deny template for device grant
  • 0d852bdc - Add template for device grant status
  • 8f1edf6e - Update changelog

Compare with previous version

added 219 commits <ul><li>8034f228...afcbde33 - 215 commits from branch <code>master</code></li><li>d0e645c8 - Add template for user code form</li><li>137b3446 - Add accept deny template for device grant</li><li>0d852bdc - Add template for device grant status</li><li>8f1edf6e - Update changelog</li></ul> [Compare with previous version](/AlekSIS/official/AlekSIS-Core/-/merge_requests/1948/diffs?diff_id=83539&start_sha=8034f228d55ab3bb5eeb68aacdee2f06dcb2875c)
Author
Member

.

.
Author
Member

marked this merge request as ready

marked this merge request as **ready**
Owner

How is the login triggered in the frontend?
Does it also support scanning a QR code with an authorize URL to login?

How is the login triggered in the frontend? Does it also support scanning a QR code with an authorize URL to login?
Author
Member

No, currently one has to manually visit https://aleksis.example.org/oauth/device and enter the user code there.

No, currently one has to manually visit `https://aleksis.example.org/oauth/device` and enter the user code there.
Author
Member

added 31 commits

  • 8f1edf6e...25883a26 - 26 commits from branch master
  • 5be924a7 - Add template for user code form
  • 4394957d - Add accept deny template for device grant
  • f470c526 - Add template for device grant status
  • 281e4c55 - Update changelog
  • 24bdc3fc - Configure device grant verification URIs

Compare with previous version

added 31 commits <ul><li>8f1edf6e...25883a26 - 26 commits from branch <code>master</code></li><li>5be924a7 - Add template for user code form</li><li>4394957d - Add accept deny template for device grant</li><li>f470c526 - Add template for device grant status</li><li>281e4c55 - Update changelog</li><li>24bdc3fc - Configure device grant verification URIs</li></ul> [Compare with previous version](/AlekSIS/official/AlekSIS-Core/-/merge_requests/1948/diffs?diff_id=83797&start_sha=8f1edf6ed470f0f96bce1032924795611aacc5d1)
Author
Member
Now it does: https://github.com/django-oauth/django-oauth-toolkit/pull/1658/changes
Owner

How is that verification_uri_complete communicated to the client? Whhat OIDC spec is this?

How is that `verification_uri_complete` communicated to the client? Whhat OIDC spec is this?
Author
Member

https://datatracker.ietf.org/doc/html/rfc8628#section-3.2

Just like verification_uri it is included in the Device Authorization Response.

https://datatracker.ietf.org/doc/html/rfc8628#section-3.2 Just like `verification_uri` it is included in the `Device Authorization Response`.
Owner

marked this merge request as draft

marked this merge request as **draft**
Author
Member

added 427 commits

  • 24bdc3fc...d4b1dca2 - 422 commits from branch master
  • 3cfc9a39 - Add template for user code form
  • 807a4a63 - Add accept deny template for device grant
  • f1da4c60 - Add template for device grant status
  • b942b634 - Update changelog
  • fe6f84bf - Configure device grant verification URIs

Compare with previous version

added 427 commits <ul><li>24bdc3fc...d4b1dca2 - 422 commits from branch <code>master</code></li><li>3cfc9a39 - Add template for user code form</li><li>807a4a63 - Add accept deny template for device grant</li><li>f1da4c60 - Add template for device grant status</li><li>b942b634 - Update changelog</li><li>fe6f84bf - Configure device grant verification URIs</li></ul> [Compare with previous version](/AlekSIS/official/AlekSIS-Core/-/merge_requests/1948/diffs?diff_id=85527&start_sha=24bdc3fc800daa4e26ab45af0ec829a9632296f6)
Member

added 4 commits

  • e3e53af4 - Rename oauth applications page to "services and devices"
  • f3aacefc - Fix revoke-dialog closing
  • afb4fe93 - Wrap oauth device urls in vue LegacyBaseTemplate.vue blocks
  • 289b5d7f - Link to device auth views from oauth services page

Compare with previous version

added 4 commits <ul><li>e3e53af4 - Rename oauth applications page to &quot;services and devices&quot;</li><li>f3aacefc - Fix revoke-dialog closing</li><li>afb4fe93 - Wrap oauth device urls in vue LegacyBaseTemplate.vue blocks</li><li>289b5d7f - Link to device auth views from oauth services page</li></ul> [Compare with previous version](/AlekSIS/official/AlekSIS-Core/-/merge_requests/1948/diffs?diff_id=85546&start_sha=fe6f84bffb7a220af49ffda2a91da07af4677de8)
Member

we should probably add documentation, especially as our urls differ from the docs from django-oidc-toolkit

we should probably add documentation, especially as our urls differ from the docs from django-oidc-toolkit
Member

output{width=900 height=563}

(fixed the bug of having to on-off toggle the switch already)
I don't however know where the 404 errors in-between come from

![output](/uploads/3649952e6a264c3a4e8b61b216a14d0e/output.mp4){width=900 height=563} (fixed the bug of having to on-off toggle the switch already) I don't however know where the 404 errors in-between come from
Member

added 1 commit

  • 2f57318d - Set correct default value of `skipAuthorization` field of oauth apps

Compare with previous version

added 1 commit <ul><li>2f57318d - Set correct default value of `skipAuthorization` field of oauth apps</li></ul> [Compare with previous version](/AlekSIS/official/AlekSIS-Core/-/merge_requests/1948/diffs?diff_id=85549&start_sha=289b5d7fbda8573b48edf6bb137489637f9f96a2)
Member

BASE_URL is configurable by end admins, can we guarantee that it will not end in a slash?

BASE_URL is configurable by end admins, can we guarantee that it will not end in a slash?
Owner

BASE_URL always ends with a slash.

`BASE_URL` always ends with a slash.
Author
Member

This is merged, so now we are waiting for a release.

This is merged, so now we are waiting for a release.
This pull request is marked as a work in progress.
This branch is out-of-date with the base branch
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 1065-oidc-device-code-grant-flow:1065-oidc-device-code-grant-flow
git switch 1065-oidc-device-code-grant-flow

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch master
git merge --no-ff 1065-oidc-device-code-grant-flow
git switch 1065-oidc-device-code-grant-flow
git rebase master
git switch master
git merge --ff-only 1065-oidc-device-code-grant-flow
git switch 1065-oidc-device-code-grant-flow
git rebase master
git switch master
git merge --no-ff 1065-oidc-device-code-grant-flow
git switch master
git merge --squash 1065-oidc-device-code-grant-flow
git switch master
git merge --ff-only 1065-oidc-device-code-grant-flow
git switch master
git merge 1065-oidc-device-code-grant-flow
git push origin master
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
aleksis/AlekSIS-Core!3593
No description provided.