Skip to content
This repository was archived by the owner on Feb 6, 2025. It is now read-only.

Commit cca46ed

Browse files
authored
Merge pull request #491 from amplication/docs/authentication-entity-net-updates
Docs: Authentication Entity Updates For .NET
2 parents 5a55629 + fd1284e commit cca46ed

File tree

1 file changed

+26
-13
lines changed

1 file changed

+26
-13
lines changed

docs/how-to/add-delete-user-entity.md

+26-13
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ However, you can choose to use your own custom Authentication entity as long as
2020

2121
## Dependencies Between the Authentication Entity and Authentication Plugins
2222

23-
The authentication plugins, such as the _NestJS Auth Module_ and others, rely on the existence of an _Authentication_ entity to handle user authentication and authorization.
23+
The authentication plugins rely on the existence of an _Authentication_ entity to handle user authentication and authorization. For Node.js services, this includes the _NestJS Auth Module_ and others. For .NET services, this includes the _ASP.NET Core Identity_ plugin.
2424

2525
If the _Authentication_ entity is not defined or is missing the required fields, the build process will fail, and the authentication plugins will not function correctly.
2626

@@ -32,15 +32,15 @@ An Authentication plugin requires an Authentication entity containing the proper
3232

3333
By default, the 'User' entity is defined as the Authentication entity, but you can [configure it](#changing-the-default-authentication-entity). If the `User` entity is created automatically, it comes with a set of default fields necessary for the authentication plugins to work correctly:
3434

35-
- `id` (required by all authentication plugins): An automatically created unique identifier of the entity. It is a required and unique field.
36-
- `createdAt` (required by all authentication plugins): An automatically created field of the time the entity was created. It is a required field.
37-
- `updatedAt` (required by all authentication plugins): An automatically created field of the last time the entity was updated. It is a required field.
35+
- `id` (required): An automatically created unique identifier of the entity. It is a required and unique field.
36+
- `createdAt` (required): An automatically created field of the time the entity was created. It is a required field.
37+
- `updatedAt` (required): An automatically created field of the last time the entity was updated. It is a required field.
3838
- `firstName`: An automatically created field for the first name of the user. It is a searchable single-line text field.
3939
- `lastName`: An automatically created field for the last name of the user. It is a searchable single-line text field.
40-
- `username` (required by NestJS Auth Module): An automatically created field for the username of the user. It is a required, unique, and searchable field.
41-
- `email` (required by NestJS Auth Module): An automatically created field for the email of the user. It is a unique and searchable field.
42-
- `password` (required by NestJS Auth Module): An automatically created field for the password of the user. It is a required field.
43-
- `roles` (required by NestJS Auth Module): An automatically created field for the roles of the user. It is a required field.
40+
- `username` (required): An automatically created field for the username of the user. It is a required, unique, and searchable field.
41+
- `email` (required): An automatically created field for the email of the user. It is a unique and searchable field.
42+
- `password` (required): An automatically created field for the password of the user. It is a required field.
43+
- `roles` (required): An automatically created field for the roles of the user. It is a required field.
4444

4545
These default fields provide the necessary information for user authentication and authorization.
4646

@@ -74,25 +74,34 @@ A popup will appear and give you additional context on restoring the _User_ enti
7474
Click on the **Restore Default** button and the original _Authentication_ entity provided by Amplication will be restored.
7575

7676
:::note
77-
You have to add the _Authentication_ entity first and then enable the [_NestJS Auth Module_ plugin](/authentication/#nestjs-auth-module-mandatory).
77+
For Node.js services, you have to add the _Authentication_ entity first and then enable the [_NestJS Auth Module_ plugin](/authentication/#nestjs-auth-module-mandatory).
78+
For .NET services, the process is similar, but you'll be working with the ASP.NET Core Identity plugin instead.
79+
7880
If you try to install the auth plugin first without the _Authentication_ entity, **you will be offered to create it**.
7981
:::
8082

8183
## Deleting The Authentication Entity
8284

8385
Usually, it's possible to delete any Entity that you create on your service.
8486
But, the _Authentication_ entity is special.
85-
In order to delete it, you must first disable the _NestJS Auth Module_ **and any other authentication plugins you installed**.
87+
In order to delete it, you must first disable the authentication plugin for your service.
88+
89+
For Node.js services, this means disabling the _NestJS Auth Module_ **and any other authentication plugins you installed**.
90+
91+
For .NET services, this involves disabling the ASP.NET Core Identity plugin from your service.
8692

8793
:::caution
8894
It's possible to restore the original _Authentication_ entity provided by Amplication, but any additional fields or permissions you added will be permanently deleted.
8995
:::
9096

9197
Follow these steps to delete the _Authentication_ entity:
9298

93-
1. Visit your service's Plugins page and toggle the _NestJS Auth Module_ to the off state. Additional Authentication Plugins also need to be disabled if any were installed.
99+
1. Visit your service's Plugins page and disable the authentication plugin for your service type.
100+
101+
- For Node.js: Toggle the _NestJS Auth Module_ to the off state. Additional Authentication Plugins also need to be disabled if any were installed.
102+
- For .NET: Disable the ASP.NET Core Identity plugin on your service.
94103

95-
![Disable the NestJS Auth Module](./../getting-started/assets/authentication/disable_auth_plugin.png)
104+
![Disable the Authentication Plugin](./../getting-started/assets/authentication/disable_auth_plugin.png)
96105

97106
2. Visit your service's _Entities_ page.
98107
You will notice that you can now click the _Authentication_ entity's delete button. Click it and a popup will appear.
@@ -112,4 +121,8 @@ Follow these steps to change the default Authentication entity:
112121
1. Go to your service's **Settings**.
113122
2. Go to the **Authentication Entity** page.
114123
3. Pick the new Entity you want to be the Authentication entity from the **Entity List** dropdown.
115-
4. You have now set a new Authentication entity.
124+
4. You have now set a new Authentication entity.
125+
126+
:::note
127+
When changing the default Authentication entity, ensure that the new entity contains all the required fields for your service type (Node.js or .NET) as outlined in the [Authentication Entity Fields](#authentication-entity-fields) section.
128+
:::

0 commit comments

Comments
 (0)