// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections.Generic;
using Microsoft.AspNet.Http.Security;
using Microsoft.AspNet.HttpFeature.Security;
using Microsoft.AspNet.PipelineCore.Security;
namespace Microsoft.AspNet.Security
{
///
/// Base Options for all authentication middleware
///
public abstract class AuthenticationOptions
{
private string _authenticationType;
///
/// The AuthenticationType in the options corresponds to the IIdentity AuthenticationType property. A different
/// value may be assigned in order to use the same authentication middleware type more than once in a pipeline.
///
public string AuthenticationType
{
get { return _authenticationType; }
set
{
_authenticationType = value;
Description.AuthenticationType = value;
}
}
///
/// If Active the authentication middleware alter the request user coming in and
/// alter 401 Unauthorized responses going out. If Passive the authentication middleware will only provide
/// identity and alter responses when explicitly indicated by the AuthenticationType.
///
public AuthenticationMode AuthenticationMode { get; set; } = AuthenticationMode.Active;
///
/// Additional information about the authentication type which is made available to the application.
///
public AuthenticationDescription Description { get; set; } = new AuthenticationDescription();
}
}