// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using Microsoft.AspNetCore.Http;
namespace Microsoft.AspNetCore.Authentication
{
///
/// Context used for challenges.
///
public class ChallengeContext : BaseAuthenticationContext
{
///
/// Constructor.
///
/// The context.
/// The name of the scheme.
public ChallengeContext(HttpContext httpContext, string authenticationScheme)
: this(httpContext, authenticationScheme, properties: null, behavior: ChallengeBehavior.Automatic)
{ }
///
/// Constructor
///
/// The context.
/// The name of the scheme.
/// The properties.
/// The challenge behavior.
public ChallengeContext(HttpContext httpContext, string authenticationScheme, AuthenticationProperties properties, ChallengeBehavior behavior)
: base(httpContext, authenticationScheme, properties)
{
if (string.IsNullOrEmpty(authenticationScheme))
{
throw new ArgumentException(nameof(authenticationScheme));
}
Behavior = behavior;
}
///
/// The challenge behavior.
///
public ChallengeBehavior Behavior { get; }
}
}