Skip to content

Commit a4c4526

Browse files
authored
Add AuthenticationDisplayName to HttpSys (#21410)
* Add AuthenticationDisplayName to HttpSys * update reference assembly * Update Microsoft.AspNetCore.Server.HttpSys.netcoreapp.cs * Trigger build
1 parent d902e04 commit a4c4526

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

src/Servers/HttpSys/ref/Microsoft.AspNetCore.Server.HttpSys.netcoreapp.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ public sealed partial class AuthenticationManager
1515
{
1616
internal AuthenticationManager() { }
1717
public bool AllowAnonymous { get { throw null; } set { } }
18+
public string AuthenticationDisplayName { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
1819
public bool AutomaticAuthentication { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
1920
public Microsoft.AspNetCore.Server.HttpSys.AuthenticationSchemes Schemes { get { throw null; } set { } }
2021
}

src/Servers/HttpSys/src/AuthenticationManager.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ public bool AllowAnonymous
6161
/// </summary>
6262
public bool AutomaticAuthentication { get; set; } = true;
6363

64+
/// <summary>
65+
/// Sets the display name shown to users on login pages. The default is null.
66+
/// </summary>
67+
public string AuthenticationDisplayName { get; set; }
68+
6469
internal void SetUrlGroupSecurity(UrlGroup urlGroup)
6570
{
6671
Debug.Assert(_urlGroup == null, "SetUrlGroupSecurity called more than once.");

src/Servers/HttpSys/src/MessagePump.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public MessagePump(IOptions<HttpSysOptions> options, ILoggerFactory loggerFactor
4848

4949
if (_options.Authentication.Schemes != AuthenticationSchemes.None)
5050
{
51-
authentication.AddScheme(new AuthenticationScheme(HttpSysDefaults.AuthenticationScheme, displayName: null, handlerType: typeof(AuthenticationHandler)));
51+
authentication.AddScheme(new AuthenticationScheme(HttpSysDefaults.AuthenticationScheme, displayName: _options.Authentication.AuthenticationDisplayName, handlerType: typeof(AuthenticationHandler)));
5252
}
5353

5454
Features = new FeatureCollection();

0 commit comments

Comments
 (0)