| | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 2 | | // Licensed under the MIT License. |
| | 3 | |
|
| | 4 | | using Microsoft.Identity.Client; |
| | 5 | | using System; |
| | 6 | | using System.Collections.Generic; |
| | 7 | | using System.Text; |
| | 8 | |
|
| | 9 | | namespace Azure.Identity |
| | 10 | | { |
| | 11 | | /// <summary> |
| | 12 | | /// Details of the device code to present to a user to allow them to authenticate through the device code authentica |
| | 13 | | /// </summary> |
| | 14 | | public struct DeviceCodeInfo |
| | 15 | | { |
| | 16 | | internal DeviceCodeInfo(DeviceCodeResult deviceCode) |
| | 17 | | { |
| 20 | 18 | | UserCode = deviceCode.UserCode; |
| 20 | 19 | | DeviceCode = deviceCode.DeviceCode; |
| 20 | 20 | | VerificationUri = new Uri(deviceCode.VerificationUrl); |
| 20 | 21 | | ExpiresOn = deviceCode.ExpiresOn; |
| 20 | 22 | | Message = deviceCode.Message; |
| 20 | 23 | | ClientId = deviceCode.ClientId; |
| 20 | 24 | | Scopes = deviceCode.Scopes; |
| 20 | 25 | | } |
| | 26 | |
|
| | 27 | | /// <summary> |
| | 28 | | /// User code returned by the service |
| | 29 | | /// </summary> |
| 0 | 30 | | public string UserCode { get; private set; } |
| | 31 | |
|
| | 32 | | /// <summary> |
| | 33 | | /// Device code returned by the service |
| | 34 | | /// </summary> |
| 0 | 35 | | public string DeviceCode { get; private set; } |
| | 36 | |
|
| | 37 | | /// <summary> |
| | 38 | | /// Verification URL where the user must navigate to authenticate using the device code and credentials. |
| | 39 | | /// </summary> |
| 0 | 40 | | public Uri VerificationUri { get; private set; } |
| | 41 | |
|
| | 42 | | /// <summary> |
| | 43 | | /// Time when the device code will expire. |
| | 44 | | /// </summary> |
| 0 | 45 | | public DateTimeOffset ExpiresOn { get; private set; } |
| | 46 | |
|
| | 47 | | /// <summary> |
| | 48 | | /// User friendly text response that can be used for display purpose. |
| | 49 | | /// </summary> |
| 32 | 50 | | public string Message { get; private set; } |
| | 51 | |
|
| | 52 | | /// <summary> |
| | 53 | | /// Identifier of the client requesting device code. |
| | 54 | | /// </summary> |
| 0 | 55 | | public string ClientId { get; private set; } |
| | 56 | |
|
| | 57 | | /// <summary> |
| | 58 | | /// List of the scopes that would be held by token. |
| | 59 | | /// </summary> |
| 0 | 60 | | public IReadOnlyCollection<string> Scopes { get; private set; } |
| | 61 | | } |
| | 62 | | } |