OAuth 2.0 Device FlowGoogle1600 Amphitheatre PkwyMountain ViewCA94043USA+1 650-253-0000wdenniss@google.comhttp://google.com/ForgeRockLysaker torg 2Lysaker1366NORWAYstein.myrseth@forgerock.comPing Identityve7jtb@ve7jtb.comhttp://www.thread-safe.com/Microsoftmbj@microsoft.comhttp://self-issued.info/ARM LimitedAustriaHannes.Tschofenig@gmx.nethttp://www.tschofenig.priv.at
Security Area
OAuthOAuthSecurityAuthorizationIoTInternet of ThingsSmart Objects
The device flow is suitable for OAuth 2.0 clients executing on
devices that do not have an easy data-entry method (e.g., game
consoles, TVs, picture frames, and media hubs), but where the end-user has separate access
to a user-agent on another computer or device (e.g., desktop computer, a
laptop, a smart phone, or a tablet).
The device flow is suitable for clients executing on devices that
do not have an easy data-entry method and where the client is
incapable of receiving incoming requests from
the authorization server (incapable of acting as an HTTP server).
Instead of interacting with the end-user's user-agent, the client
instructs the end-user to use another computer or device and connect
to the authorization server to approve the access request. Since the
client cannot receive incoming requests, it polls the authorization
server repeatedly until the end-user completes the approval process.Note that this device flow does not utilize the client secret.
The device flow illustrated in includes the following steps:
(A) The client requests access from the authorization server and
includes its client identifier in the request.(B) The authorization server issues a verification code, an end-user
code, and provides the end-user verification URI.(C) The client instructs the end-user to use its user-agent
(elsewhere) and visit the provided end-user verification URI.
The client provides the end-user with the end-user code to enter
in order to grant access.(D) The authorization server authenticates the end-user (via the
user-agent) and prompts the end-user to grant the client's
access request. If the end-user agrees to the client's access
request, the end-user enters the end-user code provided by the
client. The authorization server validates the end-user code
provided by the end-user.(E) While the end-user authorizes (or denies) the client's request
(D), the client repeatedly polls the authorization server to
find out if the end-user completed the end-user authorization
step. The client includes the verification code and its client
identifier.(F) Assuming the end-user granted access, the authorization server
validates the verification code provided by the client and
responds back with the access token.The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
"OPTIONAL" in this document are to be interpreted as described in .
The authorization server's endpoint capable of issuing
verification codes, user codes, and verification URLs.
A short-lived token representing an authorization session.
A short-lived token which the device displays to the end user,
is entered by the end-user on the authorization sever, and is
thus used to bind the device to the end-user.
The client initiates the flow by requesting a set of verification
codes from the authorization server by making an HTTP "POST" request
to the device endpoint. The client constructs a request URI by
adding the following parameters to the request:
REQUIRED. The parameter value MUST be set to "device_code".
REQUIRED. The client identifier as described in Section 2.2 of
.
OPTIONAL. The scope of the access request as described by
Section 3.3 of .
For example, the client makes the following HTTPS request (line
breaks are for display purposes only):
In response, the authorization server generates a verification code
and an end-user code and includes them in the HTTP response body
using the "application/json" format with a 200 status code (OK). The
response contains the following parameters:
REQUIRED. The verification code.
REQUIRED. The end-user verification code.
REQUIRED. The end-user verification URI on the authorization
server. The URI should be short and easy to remember as end-
users will be asked to manually type it into their user-agent.
OPTIONAL. The duration in seconds of the verification code
lifetime.
OPTIONAL. The minimum amount of time in seconds that the
client SHOULD wait between polling requests to the token
endpoint.
For example:
The client displays the end-user code and the end-user verification
URI to the end-user, and instructs the end-user to visit the URI
using a user-agent and enter the end-user code.
The end-user manually types the provided verification URI and
authenticates with the authorization server. The authorization
server prompts the end-user to authorize the client's request by
entering the end-user code provided by the client. Once the end-user
approves or denies the request, the authorization server informs the
end-user to return to the device for further instructions.
Since the client is unable to receive incoming requests from the
authorization server, it polls the authorization server repeatedly
until the end-user grants or denies the request, or the verification
code expires.
The client makes the following request at an arbitrary but reasonable
interval which MUST NOT exceed the minimum interval rate provided by
the authorization server (if present via the "interval" parameter).
Alternatively, the client MAY provide a user interface for the end-
user to manually inform it when authorization was granted.
The client requests an access token by making an HTTP "POST" request
to the token endpoint as described in Section 4.1.1 of
. The "redirect_uri" parameter is NOT REQUIRED as
part of this request.
The following error responses are defined in addition to those within
Section 4.2.2.1. of :
The authorization request is still pending as the end-user
hasn't yet visited the authorization server and entered their
verification code.
The client is polling too quickly and should back off at a
reasonable rate.
TBD
The -00 version of this document was based on draft-recordon-oauth-v2-device
edited by David Recordon and Brent Goldman. The content of that document
was initially part of the OAuth 2.0 protocol specification but was later
removed due to the lack of sufficient deployment expertise at that time.
We would therefore also like to thank the OAuth working group for their
work on the initial content of this specification through 2010.
[[ to be removed by the RFC Editor before publication as an RFC ]]
-01
Applied spelling and grammar corrections and added the Document History appendix.
-00
Initial working group draft based on draft-recordon-oauth-v2-device.