Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add device flow documentation #2026

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

nsklikas
Copy link

Related Issue or Design Document

Adds docs for the device flow as implemented in ory/hydra#3912.

Checklist

  • I have read the contributing guidelines and signed the CLA.
  • I have referenced an issue containing the design document if my change introduces a new feature.
  • I have read the security policy.
  • I confirm that this pull request does not address a security vulnerability.
    If this pull request addresses a security vulnerability,
    I confirm that I got approval (please contact [email protected]) from the maintainers to push the changes.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added the necessary documentation within the code base (if appropriate).

Further comments

I am not sure if this is the right place to place the doc, The rest of the docs in that folder do not reference hydra configurations, but the docs in the hydra folder do not seem to document oauth2/oidc flows. Please let me know if there is a better place for it.

Copy link
Member

@vinckr vinckr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks so much, this already looks great!

left a couple of comments to bring the doc in line with our docs style guide.

content wise this looks very good - I did not test it out in practice though

sidebar_label: Device authorization flow
---

The OAuth 2.0 Device Authorization Grant (also known as Device Flow) is OAuth 2.0 extension that enables devices with no browser
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The OAuth 2.0 Device Authorization Grant (also known as Device Flow) is OAuth 2.0 extension that enables devices with no browser
The OAuth 2.0 Device Authorization Grant -also known as Device Flow- is OAuth 2.0 extension that enables devices with no browser

generally try to avoid parentheses in text

Comment on lines +9 to +10
such as smart TVs, gaming consoles, or IoT devices, by delegating the authentication process to another device with a full browser
(e.g., a smartphone or computer).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
such as smart TVs, gaming consoles, or IoT devices, by delegating the authentication process to another device with a full browser
(e.g., a smartphone or computer).
such as smart TVs, gaming consoles, or IoT devices, by delegating the authentication process to another device with a full browser such as a smartphone or computer.

avoid abbreviations like e.g.

This document provides an overview of the Device Authorization Grant, a step-by-step example of its implementation, configuration
options, and guidance on creating custom user interfaces for the verification screen.

## Overview of the Flow
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Overview of the Flow
## Overview of the flow

sentence casing in headlines

Comment on lines +20 to +22
2. The user is instructed to visit a URL on a different device and is given a user code.
3. On a different device the user, visits the URL, provides the user code, logs in and grants access to the device.
4. The device polls the Authorization server. Once the user authenticates and grants access, an access token is returned that can
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
2. The user is instructed to visit a URL on a different device and is given a user code.
3. On a different device the user, visits the URL, provides the user code, logs in and grants access to the device.
4. The device polls the Authorization server. Once the user authenticates and grants access, an access token is returned that can
1. The user is instructed to visit a URL on a different device and is given a user code.
1. On a different device the user, visits the URL, provides the user code, logs in and grants access to the device.
1. The device polls the Authorization server. Once the user authenticates and grants access, an access token is returned that can

markdown should number this automatically


Here is the high-level overview for the Device Authorization Flow:

1. The device requests to be authorized from the Authorization server.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is "Authorization server" a term that is specific to this flow here?

If yes I would say capitalize it as "Authorization Server"; pelase use "authorization server" throughout the document.

Once the user enters the code, they are prompted to log in (if not already authenticated) and grant or deny permission to the
client. After granting permission, the user is redirected to a page confirming successful login.

## Step 4: Device Polls for the Access Token
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Step 4: Device Polls for the Access Token
## Step 4: Device polls for the access token

see above


The user visits the provided URL on a separate device (e.g., a smartphone) and enters the code.

## Step 3: User Grants Permission
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Step 3: User Grants Permission
## Step 3: User grants permission

see above


---

## Step 2: Display User Code and Verification URL
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Step 2: Display User Code and Verification URL
## Step 2: Display user code and verification URI

is it URL or URI?

4. The device polls the Authorization server. Once the user authenticates and grants access, an access token is returned that can
be used to access the protected resource.

### Step 1: Device Requests Authorization
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### Step 1: Device Requests Authorization
### Step 1: Device requests authorization


Keep in mind that higher entropy may make it harder for the user to enter the user_code.

## Device Verification UI implementation
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Device Verification UI implementation
## Device verification user interface implementation

@vinckr
Copy link
Member

vinckr commented Feb 21, 2025

as for the place of the doc and also place in the sidebar we can check what the best place is once its ready to merge.

@christiannwamba is currently working on a restructure of the docs, so depending on when its ready to merge we might have a different place for it.

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