title: How to disable part of default UI from ASP.NET Core Identity
body: <p>I am confused with adding ASP.NET Core Identity to my web app. I would like to use parts of the default UI and controllers for my Razor Pages app, such as <code>Login.cshtml</code> and <code>login.cshtml.cs</code> or the register view and controller. However, I dont want to have all the added on 30+ pages along  with it. <br>
  Scaffolding the views and controllers with .NET CLI only overrides the default RCL. That means I am still able to go to the specified URL from my home page such as <code>Name of Website/Identity/Account/AccessDenied</code>. The only way (that I have seen thus far) of disabling the default UI and controllers is to actually disable it on a per page/controller basis as outlined <a href="https://learn.microsoft.com/en-us/aspnet/core/security/authentication/scaffold-identity?view=aspnetcore-6.0&amp;tabs=visual-studio#full" rel="nofollow noreferrer">here</a>. This means Id have to add all the default UIs and controllers to my app and then disable them? Is there no other way to only use the pages and pageModels that you want while using Identity?
  <br>
  <br>
  <strong>UPDATE</strong>:
  <br>
  Here are some examples of others asking the same question. See the comment mentioned in the accepted answer to <a href="https://stackoverflow.com/questions/54194930/asp-net-core-mvc-change-default-identity-area-routes">this</a> stackoverflow question to &quot;disable registrations or change redirect routes via Startup.cs without having to scaffold&quot;
  <br>
  <br>
  Please also see <a href="https://github.com/aspnet/Identity/issues/1824" rel="nofollow noreferrer">this</a> issue on gitHub about it. Has nothing changed? Is it not easier to just forget the default UI and only add the service <code>AddIndentity</code> and not call <code>AddDefaultUI</code> then create the logic and views yourself to handle users. The whole point of adding Identity as a service is so that you dont have to write and maintain your own code. This seems backwards to me.</p>