-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Closed
Labels
area-authIncludes: Authn, Authz, OAuth, OIDC, BearerIncludes: Authn, Authz, OAuth, OIDC, Bearer
Milestone
Description
The display name is an optional thing and is typically not set for handlers that are not meant to be publicly listed. As such, the AuthenticationOptions.AddScheme() method should declare the displayName parameter as nullable (string -> string?).
aspnetcore/src/Http/Authentication.Abstractions/src/AuthenticationOptions.cs
Lines 52 to 63 in 1268b6e
| /// <summary> | |
| /// Adds an <see cref="AuthenticationScheme"/>. | |
| /// </summary> | |
| /// <typeparam name="THandler">The <see cref="IAuthenticationHandler"/> responsible for the scheme.</typeparam> | |
| /// <param name="name">The name of the scheme being added.</param> | |
| /// <param name="displayName">The display name for the scheme.</param> | |
| public void AddScheme<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)]THandler>(string name, string displayName) where THandler : IAuthenticationHandler | |
| => AddScheme(name, b => | |
| { | |
| b.DisplayName = displayName; | |
| b.HandlerType = typeof(THandler); | |
| }); |
Tratcher
Metadata
Metadata
Assignees
Labels
area-authIncludes: Authn, Authz, OAuth, OIDC, BearerIncludes: Authn, Authz, OAuth, OIDC, Bearer