Adding Identity API Endpoints and Authentication to a website using a REST API

166 views Asked by At

I'm mystified by how the SignInManager works with the IdentityAPIEndpoints.
We have a two-tiered system with a front end and an API. We have added the API endpoints to the backend, and those are working.

We have this code

builder.Services.AddAuthorization();

builder.Services
    .AddIdentityApiEndpoints<UserLoginModel>()
    .AddEntityFrameworkStores<LoginContext>()
    .AddSignInManager(); // <<<---

app.MapGroup("/account").MapIdentityApi<UserLoginModel>();
app.UseAuthentication();
app.UseAuthorization();

But how do I get the SignInManager to know about the login page and how does it know where to redirect to after login? Especially considering that they are in the front end project.
My plan is to re-write the pages from the UI scaffolding to call the API, but I can't see how to get the login page called in the first place. I'm assuming that the SignInManager is supposed to help with that.

0

There are 0 answers