You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
using Microsoft.AspNetCore.Authentication;
|
|
|
|
|
|
|
|
|
|
namespace AuthStudy.Authentication.Browser
|
|
|
|
|
{
|
|
|
|
|
public class BrowserAuthenticationOptions : AuthenticationSchemeOptions
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 允许的浏览器
|
|
|
|
|
/// </summary>
|
|
|
|
|
public List<string> AllowBrowsers { get; set; } = new List<string>();
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 允许移动设备
|
|
|
|
|
/// </summary>
|
|
|
|
|
public bool AllowMobile { get; set; } = true;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 允许爬虫
|
|
|
|
|
/// </summary>
|
|
|
|
|
public bool AllowSpider { get; set; }
|
|
|
|
|
|
|
|
|
|
public BrowserAuthenticationOptions() :
|
|
|
|
|
this(null, true, true)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public BrowserAuthenticationOptions(List<string>? allowedBrowsers, bool allowedMMobile, bool allowedSpider)
|
|
|
|
|
{
|
|
|
|
|
AllowBrowsers = allowedBrowsers ?? BrowserAuthenticationDefault.AllowBrowsers;
|
|
|
|
|
AllowMobile = allowedMMobile;
|
|
|
|
|
AllowSpider = allowedSpider;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|