// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using Microsoft.AspNetCore.Authentication.OAuth;
namespace ZeroFramework.IdentityServer.API.Infrastructure.Authentication.Microsoft;
///
/// 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
///
public class MicrosoftChallengeProperties : OAuthChallengeProperties
{
///
/// The parameter key for the "response_mode" argument being used for a challenge request.
///
[Obsolete("This parameter is not supported in MicrosoftAccountHandler.")]
public static readonly string ResponseModeKey = "response_mode";
///
/// The parameter key for the "domain_hint" argument being used for a challenge request.
///
public static readonly string DomainHintKey = "domain_hint";
///
/// The parameter key for the "login_hint" argument being used for a challenge request.
///
public static readonly string LoginHintKey = "login_hint";
///
/// The parameter key for the "prompt" argument being used for a challenge request.
///
public static readonly string PromptKey = "prompt";
///
/// Initializes a new instance for .
///
public MicrosoftChallengeProperties()
{ }
///
/// Initializes a new instance for .
///
///
public MicrosoftChallengeProperties(IDictionary items)
: base(items)
{ }
///
/// Initializes a new instance for .
///
///
public MicrosoftChallengeProperties(IDictionary items, IDictionary parameters)
: base(items, parameters)
{ }
///
/// Gets or sets the value for the response_mode 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: query, fragment, form_post.
///
[Obsolete("This parameter is not supported in MicrosoftAccountHandler.")]
public string? ResponseMode
{
get => GetParameter(ResponseModeKey);
set => SetParameter(ResponseModeKey, value);
}
///
/// Gets or sets the value for the "domain_hint" parameter value being used for a challenge request.
///
/// 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.
///
///
public string? DomainHint
{
get => GetParameter(DomainHintKey);
set => SetParameter(DomainHintKey, value);
}
///
/// Gets or sets the value for the "login_hint" parameter value being used for a challenge request.
///
/// 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.
///
///
public string? LoginHint
{
get => GetParameter(LoginHintKey);
set => SetParameter(LoginHintKey, value);
}
///
/// Gets or sets the value for the "prompt" parameter value being used for a challenge request.
///
/// Indicates the type of user interaction that is required. The only valid values at this time are login, none, and consent.
///
///
public string? Prompt
{
get => GetParameter(PromptKey);
set => SetParameter(PromptKey, value);
}
}