Add AuthenticationDisplayName to HttpSys (#21410)

* Add AuthenticationDisplayName to HttpSys

* update reference assembly

* Update Microsoft.AspNetCore.Server.HttpSys.netcoreapp.cs

* Trigger build
This commit is contained in:
Kahbazi 2020-05-02 20:41:51 +04:30 committed by GitHub
parent d902e041f9
commit a4c45262fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 1 deletions

View File

@ -15,6 +15,7 @@ namespace Microsoft.AspNetCore.Server.HttpSys
{
internal AuthenticationManager() { }
public bool AllowAnonymous { get { throw null; } set { } }
public string AuthenticationDisplayName { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
public bool AutomaticAuthentication { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
public Microsoft.AspNetCore.Server.HttpSys.AuthenticationSchemes Schemes { get { throw null; } set { } }
}

View File

@ -61,6 +61,11 @@ namespace Microsoft.AspNetCore.Server.HttpSys
/// </summary>
public bool AutomaticAuthentication { get; set; } = true;
/// <summary>
/// Sets the display name shown to users on login pages. The default is null.
/// </summary>
public string AuthenticationDisplayName { get; set; }
internal void SetUrlGroupSecurity(UrlGroup urlGroup)
{
Debug.Assert(_urlGroup == null, "SetUrlGroupSecurity called more than once.");

View File

@ -48,7 +48,7 @@ namespace Microsoft.AspNetCore.Server.HttpSys
if (_options.Authentication.Schemes != AuthenticationSchemes.None)
{
authentication.AddScheme(new AuthenticationScheme(HttpSysDefaults.AuthenticationScheme, displayName: null, handlerType: typeof(AuthenticationHandler)));
authentication.AddScheme(new AuthenticationScheme(HttpSysDefaults.AuthenticationScheme, displayName: _options.Authentication.AuthenticationDisplayName, handlerType: typeof(AuthenticationHandler)));
}
Features = new FeatureCollection();