Compare commits
22 Commits
tests/e2e/
...
patch-1
Author | SHA1 | Date | |
---|---|---|---|
c4271b1ff7 | |||
d37f025881 | |||
149815885d | |||
be46545613 | |||
9d3822373a | |||
ab84adc13f | |||
689c59fe1c | |||
b8578623fc | |||
ae4947e85b | |||
5e840baf84 | |||
df5ec2c020 | |||
f4c64b49c2 | |||
1c022cb366 | |||
ebd620562c | |||
7ecdc1e681 | |||
56bb76c4ef | |||
8c2ba9176b | |||
11cbde771b | |||
14b6fc5d85 | |||
5d8630595d | |||
54f4b83cf7 | |||
3b6de494c9 |
@ -1,18 +1,18 @@
|
||||
# Device code flow
|
||||
|
||||
(Also known as device flow and [RFC 8628](https://datatracker.ietf.org/doc/html/rfc8628))
|
||||
The device code flow is also known as _device flow_ or _device authorization grant flow_. This type of authentication flow is useful for devices with limited input capabilities and/or devices without browsers. The Request for Comments (RFC) 8628) abstract for this flow states:
|
||||
|
||||
This type of authentication flow is useful for devices with limited input abilities and/or devices without browsers.
|
||||
> The OAuth 2.0 device authorization grant is designed for Internet-connected devices that either lack a browser to perform a user-agent-based authorization or are input constrained to the extent that requiring the user to input text in order to authenticate during the authorization flow is impractical. It enables OAuth clients on such devices (like smart TVs, media consoles, digital picture frames, and printers) to obtain user authorization to access protected resources by using a user agent on a separate device.
|
||||
|
||||
### Requirements
|
||||
|
||||
This device flow is only possible if the active brand has a device code flow setup. This device code flow is run _after_ the user logs in, and before the user authenticates.
|
||||
This device flow is only possible if the active [brand](../../../sys-mgmt/brands.md) has a device code flow configured. This flow is run _after_ the user logs in, and before the user authenticates.
|
||||
|
||||
authentik doesn't ship with a default flow for this usecase, so it is recommended to create a new flow for this usecase with the designation of _Stage configuration_
|
||||
authentik does not include a default flow for this use case, so it is necessary to create a new one with a **Designation** of `Stage Configuration`.
|
||||
|
||||
### Device-side
|
||||
### Device flow initiation
|
||||
|
||||
The flow is initiated by sending a POST request to the device authorization endpoint, `/application/o/device/` with the following contents:
|
||||
The flow is initiated by sending a POST request to the device authorization endpoint, `/application/o/device/`, with the following contents:
|
||||
|
||||
```http
|
||||
POST /application/o/device/ HTTP/1.1
|
||||
@ -32,8 +32,6 @@ The response contains the following fields:
|
||||
- `expires_in`: The total seconds after which this token will expire
|
||||
- `interval`: The interval in seconds for how often the device should check the token status
|
||||
|
||||
---
|
||||
|
||||
With this response, the device can start checking the status of the token by sending requests to the token endpoint like this:
|
||||
|
||||
```http
|
||||
@ -50,7 +48,7 @@ If the user has not opened the link above yet, or has not finished the authentic
|
||||
|
||||
If the user _has_ finished the authentication and authorization, the response will be similar to any other generic OAuth2 Token request, containing `access_token` and `id_token`.
|
||||
|
||||
### Creating and applying a device code flow
|
||||
### Create and apply a device code flow
|
||||
|
||||
1. Log in to authentik as an admin, and open the authentik Admin interface.
|
||||
2. Navigate to **Flows and Stages** > **Flows** and click **Create**.
|
||||
|
Reference in New Issue
Block a user