-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Provide Microsoft.AspNetCore.Identity.EntityFrameworkCore package README
#57537
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
MackinnonBuck
merged 8 commits into
main
from
mbuck/readme-aspnetcore-identity-entityframeworkcore
Aug 30, 2024
Merged
Changes from 2 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
b5293bd
Add PACKAGE.md
MackinnonBuck 5a73cdf
Update PACKAGE.md
MackinnonBuck 80521b7
Update PACKAGE.md
MackinnonBuck e736271
Update src/Identity/EntityFrameworkCore/src/PACKAGE.md
MackinnonBuck 7df9a08
Update src/Identity/EntityFrameworkCore/src/PACKAGE.md
MackinnonBuck 9c10852
Update src/Identity/EntityFrameworkCore/src/PACKAGE.md
MackinnonBuck 40b9c71
Update src/Identity/EntityFrameworkCore/src/PACKAGE.md
MackinnonBuck 2d0b9d7
Update src/Identity/EntityFrameworkCore/src/PACKAGE.md
MackinnonBuck File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| ## About | ||
|
|
||
| `Microsoft.AspNetCore.Identity.EntityFrameworkCore` utilizes Entity Framework Core to provide functionality enabling the storage of user, role, and other identity-related data in a database. | ||
|
|
||
| ## Key Features | ||
|
|
||
| * Provides user and role management | ||
| * Enables secure authentication and authorization mechanisms | ||
| * Allows storage and validatation of user passwords using hashing | ||
| * Implements sending email confirmation links for user account validation | ||
| * Provides two-factor authentication to provide an extra layer of security | ||
MackinnonBuck marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| * Protects against brute-force attacks by locking out user accounts after multiple failed login attempts | ||
MackinnonBuck marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| * Uses claims to define fine-grained access control policies | ||
| * Seamlessly integrates with Entity Framework Core for data storage and retrieval | ||
|
|
||
| ## How to Use | ||
|
|
||
| To use `Microsoft.AspNetCore.Identity.EntityFrameworkCore`, follow these steps: | ||
|
|
||
| ### Installation | ||
|
|
||
| ```sh | ||
| dotnet add package Microsoft.AspNetCore.Identity.EntityFrameworkCore | ||
| ``` | ||
|
|
||
| ### Configuration | ||
|
|
||
| After installing the package, you need to configure it in your `Startup.cs` file. Add the following code to the `ConfigureServices` method: | ||
|
|
||
| Add the following code to the `Program.cs` of your ASP.NET Core app: | ||
|
|
||
| ```csharp | ||
| builder.Services.AddDbContext<ApplicationDbContext>(options => | ||
| options.UseSqlServer(builder.Configuration.GetConnectionString("DefaultConnection"))); | ||
|
|
||
| builder.Services.AddDefaultIdentity<IdentityUser>() | ||
MackinnonBuck marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| .AddEntityFrameworkStores<ApplicationDbContext>(); | ||
| ``` | ||
|
|
||
| Make sure to replace `ApplicationDbContext` with your own database context class and `DefaultConnection` with your own connection string. | ||
MackinnonBuck marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ## Main Types | ||
|
|
||
| The main types provided by `Microsoft.AspNetCore.Identity.EntityFrameworkCore` include: | ||
|
|
||
| * `IdentityDbContext`: Provides the database context for storing and managing user, role, and other identity-related data | ||
| * `IdentityUserContext`: Provides methods and properties for querying and manipulating user information | ||
| * `RoleStore`: Provides methods for creating, updating, and deleting roles, as well as querying and managing role-related data | ||
| * `UserStore`: Provides methods for creating, updating, and deleting users, as well as querying and managing user-related data | ||
| * `UserOnlyStore`: Provides methods for creating, updating, and deleting users, as well as querying and managing user-related data for users without roles | ||
|
|
||
| ## Additional Documentation | ||
|
|
||
| For additional documentation and examples, refer to the [official documentation](https://learn.microsoft.com/aspnet/core/security/authentication/identity) on ASP.NET Core Identity. | ||
|
|
||
| ## Feedback & Contributing | ||
|
|
||
| `Microsoft.AspNetCore.Identity.EntityFrameworkCore` is released as open-source under the [MIT license](https://licenses.nuget.org/MIT). Bug reports and contributions are welcome at [the GitHub repository](https://github.com/dotnet/aspnetcore). | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.