diff --git a/src/Microsoft.AspNetCore.Authentication.Abstractions/AuthenticationScheme.cs b/src/Microsoft.AspNetCore.Authentication.Abstractions/AuthenticationScheme.cs index 77bd9e6d35..7969877550 100644 --- a/src/Microsoft.AspNetCore.Authentication.Abstractions/AuthenticationScheme.cs +++ b/src/Microsoft.AspNetCore.Authentication.Abstractions/AuthenticationScheme.cs @@ -16,8 +16,9 @@ namespace Microsoft.AspNetCore.Authentication /// Constructor. /// /// The name for the authentication scheme. + /// The display name for the authentication scheme. /// The type that handles this scheme. - public AuthenticationScheme(string name, Type handlerType) + public AuthenticationScheme(string name, string displayName, Type handlerType) { if (name == null) { @@ -34,6 +35,7 @@ namespace Microsoft.AspNetCore.Authentication Name = name; HandlerType = handlerType; + DisplayName = displayName; } /// @@ -41,6 +43,11 @@ namespace Microsoft.AspNetCore.Authentication /// public string Name { get; } + /// + /// The display name for the scheme. Null is valid and used for non user facing schemes. + /// + public string DisplayName { get; } + /// /// The type that handles this scheme. /// diff --git a/src/Microsoft.AspNetCore.Authentication.Abstractions/AuthenticationSchemeBuilder.cs b/src/Microsoft.AspNetCore.Authentication.Abstractions/AuthenticationSchemeBuilder.cs index e1ea0cbc4a..30e843c028 100644 --- a/src/Microsoft.AspNetCore.Authentication.Abstractions/AuthenticationSchemeBuilder.cs +++ b/src/Microsoft.AspNetCore.Authentication.Abstractions/AuthenticationSchemeBuilder.cs @@ -24,6 +24,11 @@ namespace Microsoft.AspNetCore.Authentication /// public string Name { get; } + /// + /// The display name for the scheme being built. + /// + public string DisplayName { get; set; } + /// /// The type responsible for this scheme. /// @@ -33,6 +38,6 @@ namespace Microsoft.AspNetCore.Authentication /// Builds the instance. /// /// - public AuthenticationScheme Build() => new AuthenticationScheme(Name, HandlerType); + public AuthenticationScheme Build() => new AuthenticationScheme(Name, DisplayName, HandlerType); } }