It's the OAuth 2.0 device code flow. It goes something like this:
- The device makes a request to the authorization server's device code endpoint
- The authorization server responds with a code to show to the user and a URL where they should enter that code
- The device displays the code and URL to the user
- The device begins periodically polling the authorization server's token endpoint
- The user visits the provided URL and provides their credentials along with the code given to them
- The next time the device polls the authorization server's token endpoint the authorization server responds with an access token that the device can use to authenticate to the protected resource
Here's a diagram from the current draft RFC describing the flow:
+----------+ +----------------+
| |>---(A)-- Client Identifier --->| |
| | | |
| |<---(B)-- Device Code, ---<| |
| | User Code, | |
| Device | & Verification URI | |
| Client | | |
| | [polling] | |
| |>---(E)-- Device Code, --->| |
| | & Client Identifier | |
| | | Authorization |
| |<---(F)-- Access Token ---<| Server |
+----------+ (& Optional Refresh Token) | |
v | |
: | |
(C) User Code & Verification URI | |
: | |
v | |
+----------+ | |
| End user | | |
| at |<---(D)-- End user reviews --->| |
| Browser | authorization request | |
+----------+ +----------------+
Figure 1: Device Authorization Flow
Since the device code flow is still just a draft, not a lot of OAuth 2.0 libraries have support for it, nor do all OAuth 2.0 identity providers. Luckily the protocol is pretty straightforward, so it shouldn't be too hard to build from scratch given a decent HTTP library. There's also a proxy server out there that can implement the device code flow on top of an existing OAuth 2.0 authorization server.