/
MicrosoftChallengeProperties.cs
101 lines (90 loc) · 4.08 KB
/
MicrosoftChallengeProperties.cs
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
using System.Collections.Generic;
using Microsoft.AspNetCore.Authentication.OAuth;
namespace Microsoft.AspNetCore.Authentication.MicrosoftAccount
{
/// <summary>
/// <see cref="AuthenticationProperties"/> for Microsoft OAuth challenge request.
/// See https://docs.microsoft.com/azure/active-directory/develop/v2-oauth2-auth-code-flow#request-an-authorization-code for reference
/// </summary>
public class MicrosoftChallengeProperties : OAuthChallengeProperties
{
/// <summary>
/// The parameter key for the "response_mode" argument being used for a challenge request.
/// </summary>
public static readonly string ResponseModeKey = "response_mode";
/// <summary>
/// The parameter key for the "domain_hint" argument being used for a challenge request.
/// </summary>
public static readonly string DomainHintKey = "domain_hint";
/// <summary>
/// The parameter key for the "login_hint" argument being used for a challenge request.
/// </summary>
public static readonly string LoginHintKey = "login_hint";
/// <summary>
/// The parameter key for the "prompt" argument being used for a challenge request.
/// </summary>
public static readonly string PromptKey = "prompt";
/// <summary>
/// Initializes a new instance for <see cref="MicrosoftChallengeProperties"/>.
/// </summary>
public MicrosoftChallengeProperties()
{ }
/// <summary>
/// Initializes a new instance for <see cref="MicrosoftChallengeProperties"/>.
/// </summary>
/// <inheritdoc />
public MicrosoftChallengeProperties(IDictionary<string, string> items)
: base(items)
{ }
/// <summary>
/// Initializes a new instance for <see cref="MicrosoftChallengeProperties"/>.
/// </summary>
/// <inheritdoc />
public MicrosoftChallengeProperties(IDictionary<string, string> items, IDictionary<string, object> parameters)
: base(items, parameters)
{ }
/// <summary>
/// Gets or sets the value for the <c>response_mode</c> parameter used for a challenge request. The response mode specifies the method
/// that should be used to send the resulting token back to the app. Can be one of the following: <c>query</c>, <c>fragment</c>, <c>form_post</c>.
/// </summary>
public string ResponseMode
{
get => GetParameter<string>(ResponseModeKey);
set => SetParameter(ResponseModeKey, value);
}
/// <summary>
/// Gets or sets the value for the "domain_hint" parameter value being used for a challenge request.
/// <para>
/// If included, authentication will skip the email-based discovery process that user goes through on the sign-in page,
/// leading to a slightly more streamlined user experience.
/// </para>
/// </summary>
public string DomainHint
{
get => GetParameter<string>(DomainHintKey);
set => SetParameter(DomainHintKey, value);
}
/// <summary>
/// Gets or sets the value for the "login_hint" parameter value being used for a challenge request.
/// <para>
/// Can be used to pre-fill the username/email address field of the sign-in page for the user, if their username is known ahead of time.
/// </para>
/// </summary>
public string LoginHint
{
get => GetParameter<string>(LoginHintKey);
set => SetParameter(LoginHintKey, value);
}
/// <summary>
/// Gets or sets the value for the "prompt" parameter value being used for a challenge request.
/// <para>
/// Indicates the type of user interaction that is required. The only valid values at this time are login, none, and consent.
/// </para>
/// </summary>
public string Prompt
{
get => GetParameter<string>(PromptKey);
set => SetParameter(PromptKey, value);
}
}
}