diff --git a/AuthStudy.Authentication.Browser/BrowserAuthenticationExtensions.cs b/AuthStudy.Authentication.Browser/BrowserAuthenticationExtensions.cs index f5ca336..18ba244 100644 --- a/AuthStudy.Authentication.Browser/BrowserAuthenticationExtensions.cs +++ b/AuthStudy.Authentication.Browser/BrowserAuthenticationExtensions.cs @@ -25,7 +25,7 @@ namespace AuthStudy.Authentication.Browser throw new ArgumentNullException(nameof(builder)); } - builder.AddService(Option.DefaultAuthenticateScheme, Option); + builder.AddService(Option); builder.AddAuthentication(options => { @@ -43,16 +43,9 @@ namespace AuthStudy.Authentication.Browser } - private static IServiceCollection AddService(this IServiceCollection builder, string defaultSchemeName, BrowserAuthenticationOptions option) + private static IServiceCollection AddService(this IServiceCollection builder, BrowserAuthenticationOptions option) { - defaultSchemeName = defaultSchemeName ?? BrowserAuthenticationDefault.SchemeName; - BrowserAuthenticationOptions defaultOption = option ?? new(); - defaultOption.DefaultScheme ??= defaultSchemeName; - defaultOption.DefaultAuthenticateScheme ??= defaultSchemeName; - defaultOption.DefaultChallengeScheme ??= defaultSchemeName; - defaultOption.DefaultForbidScheme ??= defaultSchemeName; - builder.AddSingleton(defaultOption); builder.AddSingleton(); diff --git a/AuthStudy.Authentication.Browser/BrowserAuthenticationOptions.cs b/AuthStudy.Authentication.Browser/BrowserAuthenticationOptions.cs index 2a9f618..66f8937 100644 --- a/AuthStudy.Authentication.Browser/BrowserAuthenticationOptions.cs +++ b/AuthStudy.Authentication.Browser/BrowserAuthenticationOptions.cs @@ -8,7 +8,7 @@ using Microsoft.AspNetCore.Authentication; namespace AuthStudy.Authentication.Browser { - public class BrowserAuthenticationOptions : AuthenticationOptions + public class BrowserAuthenticationOptions : AuthenticationSchemeOptions { /// /// 允许的浏览器