Open
Description
Background and Motivation
The Identity API endpoints are a much need addition to Identity framework. The current API endpoint route implementation (IdentityApiEndpointRouteBuilderExtensions.cs) has a single API to add all/multiple endpoints to the pipeline.
It would great to have control on which endpoints will be available if we don't want to have some functionality in the application.
A way to allow individual API endpoints to be added will help in plenty of scenarios.
Proposed API
namespace Microsoft.AspNetCore.Routing;
public static class IdentityApiEndpointRouteBuilderExtensions
{
public static IEndpointConventionBuilder MapIdentityApi<TUser>(this IEndpointRouteBuilder endpoints)
+ public static IEndpointConventionBuilder MapIdentityRegisterApi<TUser>(this IEndpointRouteBuilder endpoints)
+ public static IEndpointConventionBuilder MapIdentityLoginApi<TUser>(this IEndpointRouteBuilder endpoints)
+ public static IEndpointConventionBuilder MapIdentityRefreshApi<TUser>(this IEndpointRouteBuilder endpoints)
}
Usage Examples
We can add the required mapping for each endpoint.
app.MapIdentityLoginApi<IdentityUser>();
app.MapIdentityRefreshApi<IdentityUser>();
Alternative Designs
We have the option of adding the full code from this URL into the project and remove the unwanted parts. But that's not a great experience.
Risks
Nothing that I can think of.