AspNetCore.Docs icon indicating copy to clipboard operation
AspNetCore.Docs copied to clipboard

More Specificity on How To Delete your existing Identity code.

Open brinehart opened this issue 8 years ago • 13 comments

A link to an article on how to delete your Identity code, specifically from a previously scaffolded/created app that had Identity added on creation of a Core 2.0 App would be extremely helpful.

It can be daunting to try to identity exactly WHICH files need to be deleted and which can be kept.


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

brinehart avatar May 31 '18 14:05 brinehart

@brinehart you could do a diff on a 2.0 project with/without individual user accounts.

Rick-Anderson avatar May 31 '18 18:05 Rick-Anderson

If you already have a login system implemented, you could delete all the references and folders like Manage and Account. Then you add the new identity as described here. The best would probably be to create a different dbcontext for the new identity then you don't need to change much in your original db and the identity would be totally separate from the rest of your stuff.

BlueMarmalade avatar Jun 04 '18 07:06 BlueMarmalade

how about migrating identity 2.0 to 2.1? We have many custom changes...

andreyciocan avatar Jun 08 '18 09:06 andreyciocan

@HaoK do we need an article on migrating identity 2.0 to 2.1?

Rick-Anderson avatar Jun 08 '18 18:06 Rick-Anderson

I mean they should be fine not changing anything... there's no requirement to switch to using the default UI, it doesn't give them any new features, if they customized identity I would suggest they just leave it alone, rather than try to migrate to default identity

HaoK avatar Jun 08 '18 19:06 HaoK

Perhaps its worth mentioning that in the docs, they aren't gaining any major new functionality moving to default identity if they already have a working app.

HaoK avatar Jun 08 '18 19:06 HaoK

@HaoK how about something like:

The default UI doesn't currently provide significant new features. Replacing Identity with the RCL package is optional. The advantages to replacing the template generated Identity code with the RCL version include:

  • Many files are moved out of your source tree.
  • Any bug fixes or new features to Identity come with the M.A.App package. You automatically get the updated Identity when M.A.App is updated.

Rick-Anderson avatar Jun 09 '18 01:06 Rick-Anderson

See #6953

Rick-Anderson avatar Jun 09 '18 01:06 Rick-Anderson

I'm also confused by the code snippet from _LoginPartial.cshtml:

<ul class="nav navbar-nav navbar-right">
    <li><a asp-area="Identity" asp-page="/Account/Register">Register</a></li>
    <li><a asp-area="Identity" asp-page="/Account/Login">Log in</a></li>
</ul>

When I generate a new ASP.NET Core Web Application using 2.1 I get:

<ul class="nav navbar-nav navbar-right">
    <li><a asp-area="AzureAD" asp-controller="Account" asp-action="SignIn">Sign in</a></li>
</ul>

The are is "AzureAD" and not "Identity".

I'm confused.

olavt avatar Nov 01 '18 17:11 olavt

@olavt can you create a project with the following:

dotnet new webapp --auth  Individual -o MyTest

Make sure you've got the latest release .NET Core SDK `dotnet --version``

Rick-Anderson avatar Nov 01 '18 19:11 Rick-Anderson

@Rick-Anderson

dotnet new webapp --auth Individual -o MyTest

Ok, then I get the asp-are="Identity" rather than asp-area="AzureAD".

But, the article does not state what kind of ASP.NET Core 2.0 to 2.1 projects we are using as an example here. If you have a 2.0 application with Azure AD authentication it looks slightly different.

I think this should be clearer.

olavt avatar Nov 03 '18 08:11 olavt

@olavt it's always the default.

Rick-Anderson avatar Nov 05 '18 02:11 Rick-Anderson

This issue documents the process for those who need more info.

Rick-Anderson avatar Apr 10 '19 01:04 Rick-Anderson