Get Device Authentication Code

You can get code to verify the session with the authorization server.

Request

To retrieve a code, send the HTTP GET request to the /accounts/azure/service/getDeviceCode endpoint.

HTTP Request

GET https://<hostname>/api/v2/accounts/azure/service/getDeviceCode

Query Parameters

To control the amount and order of data in the response, you can use the following query parameters:

Query Parameter

Value

Description

azureEnvironment

string

Returns only device code available for the specified Microsoft Azure environment. For more information, see Filter Parameters.

Request Headers

The request contains the following headers.

Header

Required

Value

Description

Authorization

Required

Bearer <Access-Token>

Authenticates a client who sends the request to the server. Must contain the access token for the current logon session in the Bearer <Access-Token> format.

Response

The server returns the following response to the client.

Response Codes

A successfully completed operation returns a response code 200 (OK).

Response Headers

The response to this request contains the following headers. The response may also include additional standard HTTP headers.

Header

Value

Description

Content-length

integer

Identifies the length of the response body message, in bytes.

Content-type

  • application/json
  • application/problem+json

Identifies the media type of the response body message.

Response Body

In the response body, Veeam Backup for Microsoft Azure returns a representation of the /accounts/azure/service/getDeviceCode collection. The DeviceCodeResultV2 schema is used for the collection representation.

Get Device Authentication CodeExample

The following request returns an authentication code.

Request:

GET https://51.11.247.127/api/v2/accounts/azure/service/getDeviceCode

 

Request Header:

Authorization: Bearer <Access-Token>

 

Response:

200

 

Response Body:

{

 "userCode": "EP9MFJEW2",

 "deviceCode": "EAQABAAEAAAB2UyzwtQEKR7-rWbgdcBZIdbSmCz_jGVzBF1CAgycuaX8GM3qWaBusYr_Gfz1V-KGeqf1Z40hqDf83mK6kvCa5znFWcPVE4Oa-XVSc8eIE7ABTcC0DMy6ze9V8lw0jVDe-QMinyo6DlxE-BkODAzHr_s-u_ooxDasVWapT_5f-a-uDGVsMrVf_hLfiKzDg0UAgAA",

 "verificationUrl": "https://microsoft.com/devicelogin",

 "expiresOn": "2020-12-02T02:34:43.5362354+00:00",

 "interval": 5,

 "message": "To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code EP9MFJEW2 to authenticate.",

 "clientId": "04b07795-8ddb-461a-bbee-02f9e1bf7b46",

 "resource": "https://management.core.windows.net/"

}

I want to report a typo

There is a misspelling right here:

 

I want to let the Veeam Documentation Team know about that.