-
Notifications
You must be signed in to change notification settings - Fork 403
Expand file tree
/
Copy pathAdalResultWrapper.cs
More file actions
57 lines (46 loc) · 1.93 KB
/
AdalResultWrapper.cs
File metadata and controls
57 lines (46 loc) · 1.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using Microsoft.Identity.Client.Utils;
using Microsoft.Identity.Client.Platforms.net;
namespace Microsoft.Identity.Client.Cache
{
[JsonObject]
[Preserve(AllMembers = true)]
internal class AdalResultWrapper
{
public AdalResult Result { get; set; }
public string RawClientInfo { get; set; }
/// <summary>
/// Gets the Refresh Token associated with the requested Access Token. Note: not all operations will return a Refresh Token.
/// </summary>
public string RefreshToken { get; set; }
/// <summary>
/// Gets a value indicating whether the refresh token can be used for requesting access token for other resources.
/// </summary>
internal bool IsMultipleResourceRefreshToken => !string.IsNullOrWhiteSpace(RefreshToken) && !string.IsNullOrWhiteSpace(ResourceInResponse);
// This is only needed for AcquireTokenByAuthorizationCode in which parameter resource is optional and we need
// to get it from the STS response.
internal string ResourceInResponse { get; set; }
/// <summary>
/// Serializes the object to a JSON string
/// </summary>
/// <returns>Deserialized authentication result</returns>
public static AdalResultWrapper Deserialize(string serializedObject)
{
return JsonHelper.DeserializeFromJson<AdalResultWrapper>(serializedObject);
}
/// <summary>
/// Serializes the object to a JSON string
/// </summary>
/// <returns>Serialized authentication result</returns>
public string Serialize()
{
return JsonHelper.SerializeToJson(this);
}
public string UserAssertionHash { get; set; }
internal AdalResultWrapper Clone()
{
return Deserialize(Serialize());
}
}
}