Re-map default Identity Endpoints in Core App (Razor)

Joshy507 20 Reputation points
2024-12-28T19:33:57.36+00:00

I've added the default Indentity pages for an .Net Core 8 Razor application and everything appears to be working fine with the Account pages.

User's image My main question is how can I re-map the pages from "/Identity" to "/" (just for testing purposes for now)?

Currently:User's image

Wanted:

User's image

I did try adding "app.MapGroup("/").MapIdentityApi<IdentityUser>();" after my "app.UseAuthorization();", but it didn't seem to do anything.

User's image

Is this the proper way of re-routing the pages? This MapGroup line didn't appear to make any difference.

Thanks,

Josh

Developer technologies | ASP.NET | ASP.NET Core
{count} votes

Answer accepted by question author
  1. Bruce (SqlWork.com) 82,061 Reputation points Volunteer Moderator
    2024-12-29T18:03:22.2533333+00:00

    Microsoft identity is implemented as razor pages. It is hard coded to the area identity. It currently is not configurable. You will need to scaffold the pages and change their routing by editing the pages. you will also need to edit the login cookie options LoginPath and LogoutPath parameters to match.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.