Getting Device Code
You can obtain a device code from Microsoft Azure to sign in to the Microsoft authentication portal.
The request header must contain an authorization token of the current session.
The following parameter must be specified in the URL of the request:
Specifies the identification number of the Microsoft 365 organization. For more information on how to get this parameter, see Getting Organizations.
The server returns the following response to the client.
A successfully completed operation returns a response code 200 OK.
The response to this request contains the following headers. The response may also include additional standard HTTPS headers.
The length of the response body.
The media type and syntax of the response body message: application/json; charset=utf-8
The response body contains the following properties:
Specifies the code that you must copy and then specify on the Microsoft authentication portal.
Specifies the verification URL that you must open to sign in to Microsoft Azure.
Specifies the lifespan of the code in milliseconds.
Specifies the help message.
The example shows how to obtain a device code from Microsoft Azure to sign in to the Microsoft authentication portal.
Authorization: Bearer <Access-Token>
"message": "To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code CWE5QHLNM to authenticate."