diff options
author | Hao Kung <haokung+github@gmail.com> | 2022-07-07 03:50:44 +0300 |
---|---|---|
committer | Hao Kung <haokung+github@gmail.com> | 2022-07-07 03:50:44 +0300 |
commit | 604c8f6b165a5b08721b74f7fcf2c22af4d64537 (patch) | |
tree | ebcf69f682e4032139171e95eb6b9fdb5d876144 | |
parent | 5e0534674d1b4ba7570a2caf71cfd428e31f0ad6 (diff) |
Revert "AuthN: Use single scheme as DefaultScheme"haok/auto
This reverts commit 05f6eddd302d988330df53a5808f93a10e38b8ca.
-rw-r--r-- | src/Http/Authentication.Abstractions/src/AuthenticationOptions.cs | 15 | ||||
-rw-r--r-- | src/Http/Authentication.Abstractions/src/PublicAPI.Unshipped.txt | 2 |
2 files changed, 14 insertions, 3 deletions
diff --git a/src/Http/Authentication.Abstractions/src/AuthenticationOptions.cs b/src/Http/Authentication.Abstractions/src/AuthenticationOptions.cs index 2a92aee38e..391a3ac42d 100644 --- a/src/Http/Authentication.Abstractions/src/AuthenticationOptions.cs +++ b/src/Http/Authentication.Abstractions/src/AuthenticationOptions.cs @@ -117,5 +117,18 @@ public class AuthenticationOptions /// <summary> /// If true, DefaultScheme will not automatically use a single registered scheme. /// </summary> - public bool DisableAutoDefaultScheme { get; set; } + private bool? _disableAutoDefaultScheme; + internal bool DisableAutoDefaultScheme + { + get + { + if (!_disableAutoDefaultScheme.HasValue) + { + _disableAutoDefaultScheme = AppContext.TryGetSwitch("Microsoft.AspNetCore.Authentication.SuppressAutoDefaultScheme", out var enabled) && enabled; + } + + return _disableAutoDefaultScheme.Value; + } + set => _disableAutoDefaultScheme = value; + } } diff --git a/src/Http/Authentication.Abstractions/src/PublicAPI.Unshipped.txt b/src/Http/Authentication.Abstractions/src/PublicAPI.Unshipped.txt index 0880ddd597..f79cddf646 100644 --- a/src/Http/Authentication.Abstractions/src/PublicAPI.Unshipped.txt +++ b/src/Http/Authentication.Abstractions/src/PublicAPI.Unshipped.txt @@ -1,6 +1,4 @@ #nullable enable -Microsoft.AspNetCore.Authentication.AuthenticationOptions.DisableAutoDefaultScheme.get -> bool -Microsoft.AspNetCore.Authentication.AuthenticationOptions.DisableAutoDefaultScheme.set -> void Microsoft.AspNetCore.Authentication.IAuthenticationConfigurationProvider Microsoft.AspNetCore.Authentication.IAuthenticationConfigurationProvider.AuthenticationConfiguration.get -> Microsoft.Extensions.Configuration.IConfiguration! |