Passa al contenuto principale

3.4. Device Access Token Request (设备访问令牌请求)

🇬🇧 English

After displaying instructions to the user, the client creates an access token request and sends it to the token endpoint (as defined by Section 3.2 of [RFC6749]) with a "grant_type" of "urn:ietf:params:oauth:grant-type:device_code". This is an extension grant type (as defined by Section 4.5 of [RFC6749]) created by this specification, with the following parameters:

grant_type

  • REQUIRED. Value MUST be set to "urn:ietf:params:oauth:grant-type:device_code".

device_code

  • REQUIRED. The device verification code, "device_code" from the device authorization response, defined in Section 3.2.

client_id

  • REQUIRED if the client is not authenticating with the authorization server as described in Section 3.2.1. of [RFC6749]. The client identifier as described in Section 2.2 of [RFC6749].

For example, the client makes the following HTTPS request (line breaks are for display purposes only):

POST /token HTTP/1.1
Host: server.example.com
Content-Type: application/x-www-form-urlencoded

grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Adevice_code
&device_code=GmRhmhcxhwAzkoEqiMEg_DnyEysNkuNhszIySk9eS
&client_id=1406020730

If the client was issued client credentials (or assigned other authentication requirements), the client MUST authenticate with the authorization server as described in Section 3.2.1 of [RFC6749]. Note that there are security implications of statically distributed client credentials; see Section 5.6.

The response to this request is defined in Section 3.5. Unlike other OAuth grant types, it is expected for the client to try the access token request repeatedly in a polling fashion based on the error code in the response.


🇨🇳 中文

在向用户显示指令后,客户端创建访问令牌请求并将其发送到令牌端点([RFC6749] 第 3.2 节所定义),其 "grant_type" 为 "urn:ietf:params:oauth:grant-type:device_code"。这是本规范创建的扩展许可类型([RFC6749] 第 4.5 节所定义),具有以下参数:

grant_type (许可类型)

  • 必需 (REQUIRED)。值必须 (MUST) 设置为 "urn:ietf:params:oauth:grant-type:device_code"。

device_code (设备代码)

  • 必需 (REQUIRED)。设备验证代码,来自第 3.2 节定义的设备授权响应中的 "device_code"。

client_id (客户端标识符)

  • 如果客户端未按照 [RFC6749] 第 3.2.1 节所述与授权服务器进行身份验证,则为必需 (REQUIRED)。[RFC6749] 第 2.2 节中描述的客户端标识符。

例如,客户端发出以下 HTTPS 请求(换行仅用于显示目的):

POST /token HTTP/1.1
Host: server.example.com
Content-Type: application/x-www-form-urlencoded

grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Adevice_code
&device_code=GmRhmhcxhwAzkoEqiMEg_DnyEysNkuNhszIySk9eS
&client_id=1406020730

如果客户端被颁发了客户端凭据(或分配了其他身份验证要求),则客户端必须 (MUST) 按照 [RFC6749] 第 3.2.1 节所述与授权服务器进行身份验证。请注意,静态分发的客户端凭据存在安全隐患;参见第 5.6 节。

此请求的响应在第 3.5 节中定义。与其他 OAuth 许可类型不同,期望客户端根据响应中的错误代码以轮询方式重复尝试访问令牌请求。


🇯🇵 日本語

ユーザーに指示を表示した後、クライアントはアクセストークンリクエストを作成し、"grant_type" が "urn:ietf:params:oauth:grant-type:device_code" のトークンエンドポイント([RFC6749] のセクション 3.2 で定義)に送信します。これは、この仕様によって作成された拡張グラントタイプ([RFC6749] のセクション 4.5 で定義)であり、次のパラメータがあります:

grant_type (グラントタイプ)

  • 必須 (REQUIRED)。値は "urn:ietf:params:oauth:grant-type:device_code" に設定しなければなりません (MUST)。

device_code (デバイスコード)

  • 必須 (REQUIRED)。セクション 3.2 で定義されたデバイス認可応答からのデバイス検証コード "device_code"。

client_id (クライアント識別子)

  • [RFC6749] のセクション 3.2.1 で説明されているように、クライアントが認可サーバーで認証していない場合は必須 (REQUIRED)。[RFC6749] のセクション 2.2 で説明されているクライアント識別子。

例えば、クライアントは次の HTTPS リクエストを行います(改行は表示目的のみ):

POST /token HTTP/1.1
Host: server.example.com
Content-Type: application/x-www-form-urlencoded

grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Adevice_code
&device_code=GmRhmhcxhwAzkoEqiMEg_DnyEysNkuNhszIySk9eS
&client_id=1406020730

クライアントにクライアント資格情報が発行された(または他の認証要件が割り当てられた)場合、クライアントは [RFC6749] のセクション 3.2.1 で説明されているように認可サーバーで認証しなければなりません (MUST)。静的に配布されるクライアント資格情報にはセキュリティ上の影響があることに注意してください。セクション 5.6 を参照してください。

このリクエストへの応答はセクション 3.5 で定義されています。他の OAuth グラントタイプとは異なり、クライアントは応答内のエラーコードに基づいてポーリング方式でアクセストークンリクエストを繰り返し試行することが期待されます。


🇫🇷 Français

Après avoir affiché les instructions à l'utilisateur, le client crée une demande de jeton d'accès et l'envoie au point de terminaison de jeton (tel que défini par la Section 3.2 de [RFC6749]) avec un "grant_type" de "urn:ietf:params:oauth:grant-type:device_code". Il s'agit d'un type d'autorisation d'extension (tel que défini par la Section 4.5 de [RFC6749]) créé par cette spécification, avec les paramètres suivants:

grant_type (type d'autorisation)

  • REQUIS. La valeur DOIT être définie sur "urn:ietf:params:oauth:grant-type:device_code".

device_code (code d'appareil)

  • REQUIS. Le code de vérification de l'appareil, "device_code" de la réponse d'autorisation de l'appareil, défini dans la Section 3.2.

client_id (identifiant client)

  • REQUIS si le client ne s'authentifie pas auprès du serveur d'autorisation comme décrit dans la Section 3.2.1. de [RFC6749]. L'identifiant client comme décrit dans la Section 2.2 de [RFC6749].

Par exemple, le client effectue la requête HTTPS suivante (les sauts de ligne sont uniquement à des fins d'affichage):

POST /token HTTP/1.1
Host: server.example.com
Content-Type: application/x-www-form-urlencoded

grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Adevice_code
&device_code=GmRhmhcxhwAzkoEqiMEg_DnyEysNkuNhszIySk9eS
&client_id=1406020730

Si le client a reçu des informations d'identification du client (ou si d'autres exigences d'authentification lui ont été attribuées), le client DOIT s'authentifier auprès du serveur d'autorisation comme décrit dans la Section 3.2.1 de [RFC6749]. Notez qu'il existe des implications de sécurité pour les informations d'identification du client distribuées statiquement; voir la Section 5.6.

La réponse à cette demande est définie dans la Section 3.5. Contrairement à d'autres types d'autorisation OAuth, il est attendu que le client tente la demande de jeton d'accès de manière répétée dans un mode de sondage basé sur le code d'erreur dans la réponse.


🇩🇪 Deutsch

Nachdem dem Benutzer Anweisungen angezeigt wurden, erstellt der Client eine Zugriffstokenanfrage und sendet sie an den Token-Endpunkt (wie in Abschnitt 3.2 von [RFC6749] definiert) mit einem "grant_type" von "urn:ietf:params:oauth:grant-type:device_code". Dies ist ein Erweiterungsgenehmigungstyp (wie in Abschnitt 4.5 von [RFC6749] definiert), der durch diese Spezifikation erstellt wurde, mit den folgenden Parametern:

grant_type (Genehmigungstyp)

  • ERFORDERLICH. Der Wert MUSS auf "urn:ietf:params:oauth:grant-type:device_code" gesetzt werden.

device_code (Gerätecode)

  • ERFORDERLICH. Der Geräteverifizierungscode "device_code" aus der Geräteautorisierungsantwort, definiert in Abschnitt 3.2.

client_id (Client-Identifikator)

  • ERFORDERLICH, wenn der Client sich nicht beim Autorisierungsserver authentifiziert, wie in Abschnitt 3.2.1. von [RFC6749] beschrieben. Der Client-Identifikator, wie in Abschnitt 2.2 von [RFC6749] beschrieben.

Zum Beispiel stellt der Client die folgende HTTPS-Anfrage (Zeilenumbrüche dienen nur der Anzeige):

POST /token HTTP/1.1
Host: server.example.com
Content-Type: application/x-www-form-urlencoded

grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Adevice_code
&device_code=GmRhmhcxhwAzkoEqiMEg_DnyEysNkuNhszIySk9eS
&client_id=1406020730

Wenn dem Client Client-Anmeldeinformationen ausgestellt wurden (oder andere Authentifizierungsanforderungen zugewiesen wurden), MUSS sich der Client beim Autorisierungsserver authentifizieren, wie in Abschnitt 3.2.1 von [RFC6749] beschrieben. Beachten Sie, dass statisch verteilte Client-Anmeldeinformationen Sicherheitsauswirkungen haben; siehe Abschnitt 5.6.

Die Antwort auf diese Anfrage ist in Abschnitt 5 definiert. Im Gegensatz zu anderen OAuth-Genehmigungstypen wird erwartet, dass der Client die Zugriffstokenanfrage basierend auf dem Fehlercode in der Antwort wiederholt in einem Polling-Modus versucht.


🇮🇹 Italiano

Dopo aver visualizzato le istruzioni all'utente, il client crea una richiesta di token di accesso e la invia all'endpoint token (come definito dalla Sezione 3.2 di [RFC6749]) con un "grant_type" di "urn:ietf:params:oauth:grant-type:device_code". Questo è un tipo di concessione di estensione (come definito dalla Sezione 4.5 di [RFC6749]) creato da questa specifica, con i seguenti parametri:

grant_type (tipo di concessione)

  • RICHIESTO. Il valore DEVE essere impostato su "urn:ietf:params:oauth:grant-type:device_code".

device_code (codice dispositivo)

  • RICHIESTO. Il codice di verifica del dispositivo "device_code" dalla risposta di autorizzazione del dispositivo, definito nella Sezione 3.2.

client_id (identificatore client)

  • RICHIESTO se il client non si sta autenticando con il server di autorizzazione come descritto nella Sezione 3.2.1. di [RFC6749]. L'identificatore client come descritto nella Sezione 2.2 di [RFC6749].

Ad esempio, il client effettua la seguente richiesta HTTPS (le interruzioni di riga sono solo per scopi di visualizzazione):

POST /token HTTP/1.1
Host: server.example.com
Content-Type: application/x-www-form-urlencoded

grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Adevice_code
&device_code=GmRhmhcxhwAzkoEqiMEg_DnyEysNkuNhszIySk9eS
&client_id=1406020730

Se al client sono state rilasciate credenziali client (o assegnati altri requisiti di autenticazione), il client DEVE autenticarsi con il server di autorizzazione come descritto nella Sezione 3.2.1 di [RFC6749]. Si noti che ci sono implicazioni di sicurezza delle credenziali client distribuite staticamente; vedere la Sezione 5.6.

La risposta a questa richiesta è definita nella Sezione 3.5. A differenza di altri tipi di concessione OAuth, ci si aspetta che il client provi ripetutamente la richiesta di token di accesso in modalità polling in base al codice di errore nella risposta.