Skip to content

Commit 00da18e

Browse files
authored
Focus Identity on BWAs
1 parent 477f975 commit 00da18e

File tree

1 file changed

+52
-7
lines changed

1 file changed

+52
-7
lines changed

aspnetcore/security/authentication/identity.md

Lines changed: 52 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ uid: security/authentication/identity
1111

1212
:::moniker range=">= aspnetcore-8.0"
1313

14-
By [Rick Anderson](https://twitter.com/RickAndMSFT)
15-
1614
ASP.NET Core Identity:
1715

1816
* Is an API that supports user interface (UI) login functionality.
@@ -28,6 +26,8 @@ Identity is typically configured using a SQL Server database to store user names
2826

2927
In this topic, you learn how to use Identity to register, log in, and log out a user. Note: the templates treat username and email as the same for users. For more detailed instructions about creating apps that use Identity, see [Next Steps](#next).
3028

29+
For more information on Identity in Blazor apps, see <xref:blazor/security/index> and the articles that follow it in the Blazor documentation.
30+
3131
ASP.NET Core Identity isn't related to the [Microsoft identity platform](/azure/active-directory/develop/). Microsoft identity platform is:
3232

3333
* An evolution of the Azure Active Directory (Azure AD) developer platform.
@@ -39,7 +39,49 @@ ASP.NET Core Identity isn't related to the [Microsoft identity platform](/azure/
3939

4040
<a name="adi"></a>
4141

42-
## Create a Web app with authentication
42+
## Create a Blazor Web App with authentication
43+
44+
Create an ASP.NET Core Blazor Web App project with Individual Accounts.
45+
46+
> [!NOTE]
47+
> For a Razor Pages experience, see the [Create a Razor Pages app with authentication](#create-a-razor-pages-app-with-authentication) section.
48+
49+
# [Visual Studio](#tab/visual-studio)
50+
51+
* Select the **Blazor Web App** template and select **Next**. Name the project **BlazorApp1** to have the same namespace as the project download. Select **Next**.
52+
* Make the following selections:
53+
* **Authentication type**: **Individual Accounts**
54+
* **Interactive render mode**: **Server**
55+
* **Interactivity Location**: **Global**
56+
* Select **Create**.
57+
58+
# [.NET CLI](#tab/net-cli)
59+
60+
```dotnetcli
61+
dotnet new blazor -au Individual -o BlazorApp1
62+
```
63+
64+
The preceding command creates a Blazor Web App using SQLite. To create the web app with LocalDB, run the following command:
65+
66+
```dotnetcli
67+
dotnet new blazor -au Individual -uld -o BlazorApp1
68+
```
69+
70+
---
71+
72+
The generated project includes Identity Razor components. The components are found in the `Components/Account` folder of the project. For example:
73+
74+
* `/Components/Account/Pages/Register`
75+
* `/Components/Account/Pages/Login`
76+
* `/Components/Account/Pages/ChangePassword`
77+
78+
Blazor Identity components can be viewed in the [Blazor project template ASP.NET Core reference source (`dotnet/aspnetcore` GitHub repository)](https://github.com/dotnet/aspnetcore/tree/main/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWeb-CSharp/Components/Account).
79+
80+
[!INCLUDE[](~/includes/aspnetcore-repo-ref-source-links.md)]
81+
82+
For more information, see <xref:blazor/security/index> and the articles that follow it in the Blazor documentation. Most of the articles in the *Security and Identity* area of the main ASP.NET Core documentation set apply to Blazor apps. However, the Blazor documentation set contains articles and guidance that supercedes or adds information. We recommend studying the general ASP.NET Core documentation set first, followed by accessing the articles in the Blazor *Security and Identity* documentation.
83+
84+
## Create a Razor Pages app with authentication
4385

4486
Create an ASP.NET Core Web Application project with Individual Accounts.
4587

@@ -64,9 +106,11 @@ dotnet new webapp --auth Individual -uld -o WebApp1
64106

65107
The generated project provides [ASP.NET Core Identity](xref:security/authentication/identity) as a [Razor class library](xref:razor-pages/ui-class). The Identity Razor class library exposes endpoints with the `Identity` area. For example:
66108

67-
* /Identity/Account/Login
68-
* /Identity/Account/Logout
69-
* /Identity/Account/Manage
109+
* `/Identity/Account/Login`
110+
* `/Identity/Account/Logout`
111+
* `/Identity/Account/Manage`
112+
113+
Pages are described individually in the documentation for specific use cases and are subject to change each release. To view all of the pages, see the [ASP.NET Core reference source (`dotnet/aspnetcore` GitHub repository, `Identity/UI/src/Areas/Identity/Pages` folder)](https://github.com/dotnet/aspnetcore/tree/main/src/Identity/UI/src/Areas/Identity/Pages).
70114

71115
### Apply migrations
72116

@@ -243,10 +287,11 @@ To prevent publishing static Identity assets (stylesheets and JavaScript files f
243287

244288
## Next Steps
245289

290+
* <xref:blazor/security/index>
246291
* [ASP.NET Core Identity source code](https://github.com/dotnet/aspnetcore/tree/main/src/Identity)
247292
* [How to work with Roles in ASP.NET Core Identity](https://www.yogihosting.com/aspnet-core-identity-roles/)
248293
<!-- https://github.com/dotnet/AspNetCore.Docs/issues/7114 -->
249-
* See [this GitHub issue](https://github.com/dotnet/AspNetCore.Docs/issues/5131) for information on configuring Identity using SQLite.
294+
* For information on configuring Identity using SQLite, see [How to config Identity for SQLite (`dotnet/AspNetCore.Docs` #5131)](https://github.com/dotnet/AspNetCore.Docs/issues/5131).
250295
* [Configure Identity](xref:security/authentication/identity-configuration)
251296
* <xref:security/authorization/secure-data>
252297
* <xref:security/authentication/add-user-data>

0 commit comments

Comments
 (0)