pub struct DeviceAuthorizationResponse {
pub device_code: String,
pub expires_in: u64,
pub interval: u64,
pub message: String,
pub user_code: String,
pub verification_uri: String,
pub verification_uri_complete: Option<String>,
pub scopes: Option<BTreeSet<String>>,
pub additional_fields: HashMap<String, Value>,
}
Expand description
The Device Authorization 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 actual device code response that is received from Microsoft Graph does not include the verification_uri_complete field even though it’s in the specification. The device code response from Microsoft Graph looks like similar to the following:
{
"device_code": String("FABABAAEAAAD--DLA3VO7QrddgJg7WevrgJ7Czy_TDsDClt2ELoEC8ePWFs"),
"expires_in": Number(900),
"interval": Number(5),
"message": String("To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code FQK5HW3UF to authenticate."),
"user_code": String("FQK5HW3UF"),
"verification_uri": String("https://microsoft.com/devicelogin"),
}
Fields§
§device_code: String
A long string used to verify the session between the client and the authorization server. The client uses this parameter to request the access token from the authorization server.
expires_in: u64
The number of seconds before the device_code and user_code expire.
interval: u64
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.
message: String
User friendly text response that can be used for display purpose.
user_code: String
A short string shown to the user that’s used to identify the session on a secondary device.
verification_uri: String
Verification URL where the user must navigate to authenticate using the device code and credentials.
verification_uri_complete: Option<String>
The verification_uri_complete response field is not included or supported by Microsoft at this time. It is included here because it is part of the standard and in the case that Microsoft decides to include it.
scopes: Option<BTreeSet<String>>
List of the scopes that would be held by token.
additional_fields: HashMap<String, Value>
Trait Implementations§
Source§impl Clone for DeviceAuthorizationResponse
impl Clone for DeviceAuthorizationResponse
Source§fn clone(&self) -> DeviceAuthorizationResponse
fn clone(&self) -> DeviceAuthorizationResponse
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more