3.2. Device Authorization Response (设备授权响应)
🇬🇧 English
In response, the authorization server generates a unique device verification code and an end-user code that are valid for a limited time and includes them in the HTTP response body using the "application/json" format [RFC8259] with a 200 (OK) status code. The response contains the following parameters:
device_code
- REQUIRED. The device verification code.
user_code
- REQUIRED. The end-user verification code.
verification_uri
- 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.
verification_uri_complete
- OPTIONAL. A verification URI that includes the "user_code" (or other information with the same function as the "user_code"), which is designed for non-textual transmission.
expires_in
- REQUIRED. The lifetime in seconds of the "device_code" and "user_code".
interval
- OPTIONAL. The minimum amount of time in seconds that the client SHOULD wait between polling requests to the token endpoint. If no value is provided, clients MUST use 5 as the default.
For example:
HTTP/1.1 200 OK
Content-Type: application/json
Cache-Control: no-store
{
"device_code": "GmRhmhcxhwAzkoEqiMEg_DnyEysNkuNhszIySk9eS",
"user_code": "WDJB-MJHT",
"verification_uri": "https://example.com/device",
"verification_uri_complete":
"https://example.com/device?user_code=WDJB-MJHT",
"expires_in": 1800,
"interval": 5
}
In the event of an error (such as an invalidly configured client), the authorization server responds in the same way as the token endpoint specified in Section 5.2 of [RFC6749].
🇨🇳 中文
作为响应,授权服务器生成一个唯一的设备验证代码和一个最终用户代码,它们在有限时间内有效,并使用 "application/json" 格式 [RFC8259] 以 200 (OK) 状态码将它们包含在 HTTP 响应正文中。响应包含以下参数:
device_code (设备代码)
- 必需 (REQUIRED)。设备验证代码。
user_code (用户代码)
- 必需 (REQUIRED)。最终用户验证代码。
verification_uri (验证 URI)
- 必需 (REQUIRED)。授权服务器上的最终用户验证 URI。该 URI 应该简短且易于记忆,因为最终用户将被要求手动将其输入到其用户代理中。
verification_uri_complete (完整验证 URI)
- 可选 (OPTIONAL)。包含 "user_code"(或与 "user_code" 具有相同功能的其他信息)的验证 URI,专为非文本传输而设计。
expires_in (过期时间)
- 必需 (REQUIRED)。"device_code" 和 "user_code" 的生命周期(以秒为单位)。
interval (间隔)
- 可选 (OPTIONAL)。客户端在向令牌端点发出轮询请求之间应该 (SHOULD) 等待的最短时间(以秒为单位)。如果未提供值,客户端必须 (MUST) 使用 5 作为默认值。
例如:
HTTP/1.1 200 OK
Content-Type: application/json
Cache-Control: no-store
{
"device_code": "GmRhmhcxhwAzkoEqiMEg_DnyEysNkuNhszIySk9eS",
"user_code": "WDJB-MJHT",
"verification_uri": "https://example.com/device",
"verification_uri_complete":
"https://example.com/device?user_code=WDJB-MJHT",
"expires_in": 1800,
"interval": 5
}
如果发生错误(例如配置无效的客户端),授权服务器以与 [RFC6749] 第 5.2 节中指定的令牌端点相同的方式响应。
🇯🇵 日本語
応答として、認可サーバーは、限られた時間有効な一意のデバイス検証コードとエンドユーザーコードを生成し、それらを "application/json" 形式 [RFC8259] を使用して 200 (OK) ステータスコードで HTTP 応答本文に含めます。応答には次のパラメータが含まれます:
device_code (デバイスコード)
- 必須 (REQUIRED)。デバイス検証コード。
user_code (ユーザーコード)
- 必須 (REQUIRED)。エンドユーザー検証コード。
verification_uri (検証 URI)
- 必須 (REQUIRED)。認可サーバー上のエンドユーザー検証 URI。エンドユーザーがユーザーエージェントに手動で入力するように求められるため、URI は短く覚えやすいものである必要があります。
verification_uri_complete (完全な検証 URI)
- 任意 (OPTIONAL)。"user_code"(または "user_code" と同じ機能を持つ他の情報)を含む検証 URI で、非テキスト伝送用に設計されています。
expires_in (有効期限)
- 必須 (REQUIRED)。"device_code" と "user_code" の有効期間(秒単位)。
interval (間隔)
- 任意 (OPTIONAL)。クライアントがトークンエンドポイントへのポーリングリクエスト間で待機すべき (SHOULD) 最小時間(秒単位)。値が提供されない場合、クライアントはデフォルトとして 5 を使用しなければなりません (MUST)。
例:
HTTP/1.1 200 OK
Content-Type: application/json
Cache-Control: no-store
{
"device_code": "GmRhmhcxhwAzkoEqiMEg_DnyEysNkuNhszIySk9eS",
"user_code": "WDJB-MJHT",
"verification_uri": "https://example.com/device",
"verification_uri_complete":
"https://example.com/device?user_code=WDJB-MJHT",
"expires_in": 1800,
"interval": 5
}
エラーが発生した場合(無効に構成されたクライアントなど)、認可サーバーは [RFC6749] のセクション 5.2 で指定されたトークンエンドポイントと同じ方法で応答します。
🇫🇷 Français
En réponse, le serveur d'autorisation génère un code de vérification d'appareil unique et un code d'utilisateur final qui sont valides pendant une durée limitée et les inclut dans le corps de la réponse HTTP en utilisant le format "application/json" [RFC8259] avec un code d'état 200 (OK). La réponse contient les paramètres suivants:
device_code (code d'appareil)
- REQUIS. Le code de vérification de l'appareil.
user_code (code utilisateur)
- REQUIS. Le code de vérification de l'utilisateur final.
verification_uri (URI de vérification)
- REQUIS. L'URI de vérification de l'utilisateur final sur le serveur d'autorisation. L'URI doit être court et facile à mémoriser car les utilisateurs finaux seront invités à le saisir manuellement dans leur agent utilisateur.
verification_uri_complete (URI de vérification complet)
- OPTIONNEL. Un URI de vérification qui inclut le "user_code" (ou d'autres informations ayant la même fonction que le "user_code"), conçu pour une transmission non textuelle.
expires_in (expire dans)
- REQUIS. La durée de vie en secondes du "device_code" et du "user_code".
interval (intervalle)
- OPTIONNEL. La durée minimale en secondes que le client DEVRAIT attendre entre les requêtes de sondage au point de terminaison de jeton. Si aucune valeur n'est fournie, les clients DOIVENT utiliser 5 comme valeur par défaut.
Par exemple:
HTTP/1.1 200 OK
Content-Type: application/json
Cache-Control: no-store
{
"device_code": "GmRhmhcxhwAzkoEqiMEg_DnyEysNkuNhszIySk9eS",
"user_code": "WDJB-MJHT",
"verification_uri": "https://example.com/device",
"verification_uri_complete":
"https://example.com/device?user_code=WDJB-MJHT",
"expires_in": 1800,
"interval": 5
}
En cas d'erreur (telle qu'un client configuré de manière invalide), le serveur d'autorisation répond de la même manière que le point de terminaison de jeton spécifié dans la Section 5.2 de [RFC6749].
🇩🇪 Deutsch
Als Antwort generiert der Autorisierungsserver einen eindeutigen Geräteverifizierungscode und einen Endbenutzercode, die für eine begrenzte Zeit gültig sind, und fügt sie im HTTP-Antwortkörper im Format "application/json" [RFC8259] mit einem 200 (OK) Statuscode ein. Die Antwort enthält die folgenden Parameter:
device_code (Gerätecode)
- ERFORDERLICH. Der Geräteverifizierungscode.
user_code (Benutzercode)
- ERFORDERLICH. Der Endbenutzer-Verifizierungscode.
verification_uri (Verifizierungs-URI)
- ERFORDERLICH. Der Endbenutzer-Verifizierungs-URI auf dem Autorisierungsserver. Der URI sollte kurz und leicht zu merken sein, da Endbenutzer aufgefordert werden, ihn manuell in ihren Benutzeragenten einzugeben.
verification_uri_complete (vollständiger Verifizierungs-URI)
- OPTIONAL. Ein Verifizierungs-URI, der den "user_code" (oder andere Informationen mit derselben Funktion wie der "user_code") enthält, der für die nicht-textuelle Übertragung konzipiert ist.
expires_in (läuft ab in)
- ERFORDERLICH. Die Lebensdauer in Sekunden des "device_code" und "user_code".
interval (Intervall)
- OPTIONAL. Die minimale Zeit in Sekunden, die der Client zwischen Polling-Anfragen an den Token-Endpunkt warten SOLLTE. Wenn kein Wert angegeben wird, MÜSSEN Clients 5 als Standard verwenden.
Zum Beispiel:
HTTP/1.1 200 OK
Content-Type: application/json
Cache-Control: no-store
{
"device_code": "GmRhmhcxhwAzkoEqiMEg_DnyEysNkuNhszIySk9eS",
"user_code": "WDJB-MJHT",
"verification_uri": "https://example.com/device",
"verification_uri_complete":
"https://example.com/device?user_code=WDJB-MJHT",
"expires_in": 1800,
"interval": 5
}
Im Falle eines Fehlers (z.B. bei einem ungültig konfigurierten Client) antwortet der Autorisierungsserver auf die gleiche Weise wie der Token-Endpunkt, der in Abschnitt 5.2 von [RFC6749] angegeben ist.
🇮🇹 Italiano
In risposta, il server di autorizzazione genera un codice di verifica del dispositivo univoco e un codice utente finale che sono validi per un tempo limitato e li include nel corpo della risposta HTTP utilizzando il formato "application/json" [RFC8259] con un codice di stato 200 (OK). La risposta contiene i seguenti parametri:
device_code (codice dispositivo)
- RICHIESTO. Il codice di verifica del dispositivo.
user_code (codice utente)
- RICHIESTO. Il codice di verifica dell'utente finale.
verification_uri (URI di verifica)
- RICHIESTO. L'URI di verifica dell'utente finale sul server di autorizzazione. L'URI dovrebbe essere breve e facile da ricordare poiché agli utenti finali verrà chiesto di digitarlo manualmente nel loro agente utente.
verification_uri_complete (URI di verifica completo)
- OPZIONALE. Un URI di verifica che include il "user_code" (o altre informazioni con la stessa funzione del "user_code"), progettato per la trasmissione non testuale.
expires_in (scade tra)
- RICHIESTO. La durata in secondi del "device_code" e del "user_code".
interval (intervallo)
- OPZIONALE. La quantità minima di tempo in secondi che il client DOVREBBE attendere tra le richieste di polling all'endpoint token. Se non viene fornito alcun valore, i client DEVONO utilizzare 5 come valore predefinito.
Ad esempio:
HTTP/1.1 200 OK
Content-Type: application/json
Cache-Control: no-store
{
"device_code": "GmRhmhcxhwAzkoEqiMEg_DnyEysNkuNhszIySk9eS",
"user_code": "WDJB-MJHT",
"verification_uri": "https://example.com/device",
"verification_uri_complete":
"https://example.com/device?user_code=WDJB-MJHT",
"expires_in": 1800,
"interval": 5
}
In caso di errore (come un client configurato in modo non valido), il server di autorizzazione risponde nello stesso modo dell'endpoint token specificato nella Sezione 5.2 di [RFC6749].