ASP.NET Core Identity is a membership system that adds login functionality to ASP.NET Core apps. It provides robust features for user authentication, authorization, and managing user accounts. With Identity, you can easily integrate login functionality using various authentication methods like cookies, JWT tokens, or external providers like Google or Facebook. It offers user management capabilities such as user registration, password hashing, account confirmation, and two-factor authentication. Moreover, it seamlessly integrates with Entity Framework Core for data storage, making it highly customizable and extensible. Its flexibility and security make it a preferred choice for building secure and scalable web applications.
- CRUD Operations
- Migration Operations
- User Authentication
- Register / Login Operations
- Forgot Password
- Roles Operations
- SMTP E-Mail Sender
-
Check the database connection on the appsetting.json file. Customize the database connection path here according to your own computer. By default the database name is IdentityApp. I am using MYSQL database engine. You can enter SMTP settings from your own e-mail service.
{ "Logging": { "LogLevel": { "Default": "Information", "Microsoft.AspNetCore": "Warning" } }, "ConnectionStrings": { "DefaultConnection": "Server=localhost;Database=IdentityApp;User=;Password=;" }, "EmailSender": { "Host": "", "Port": 587, "EnableSSL": false, "Username": "username", "Password": "password" }, "AllowedHosts": "*" }
-
Type the add-migration command via the Package Manager Console.
add-migration DbCreateFirst
-
Type the update-database command via the Package Manager Console.
update-database
-
You can use the information below to enter the admin panel. You can use the /Users/Index address path for the admin panel.
// --- Identity User Information --- // private const string adminUser = ""; private const string adminPassword = ""; private const string adminEmailAddress = ""; // Add new user await userManager.CreateAsync(user, adminPassword); // Add "admin" role to new user await userManager.AddToRoleAsync(user, "admin");
You can reach out to me using the following contact details:
I'm always open to development and collaboration. Feel free to reach out to me!