diff --git a/src/Microsoft.AspNetCore.Authentication.Abstractions/AuthenticationScheme.cs b/src/Microsoft.AspNetCore.Authentication.Abstractions/AuthenticationScheme.cs
index 77bd9e6d..79698775 100644
--- a/src/Microsoft.AspNetCore.Authentication.Abstractions/AuthenticationScheme.cs
+++ b/src/Microsoft.AspNetCore.Authentication.Abstractions/AuthenticationScheme.cs
@@ -16,8 +16,9 @@ public class AuthenticationScheme
/// 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 @@ public AuthenticationScheme(string name, Type handlerType)
Name = name;
HandlerType = handlerType;
+ DisplayName = displayName;
}
///
@@ -41,6 +43,11 @@ public AuthenticationScheme(string name, Type handlerType)
///
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 e1ea0cbc..30e843c0 100644
--- a/src/Microsoft.AspNetCore.Authentication.Abstractions/AuthenticationSchemeBuilder.cs
+++ b/src/Microsoft.AspNetCore.Authentication.Abstractions/AuthenticationSchemeBuilder.cs
@@ -24,6 +24,11 @@ public AuthenticationSchemeBuilder(string name)
///
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 @@ public AuthenticationSchemeBuilder(string name)
/// Builds the instance.
///
///
- public AuthenticationScheme Build() => new AuthenticationScheme(Name, HandlerType);
+ public AuthenticationScheme Build() => new AuthenticationScheme(Name, DisplayName, HandlerType);
}
}