Skip to content

HAMZA-NASIR-PU/Asp-Net-Core-Identity-Template

Repository files navigation

Simple Asp .Net Core Identity Template

About The Project

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.

Features

  • CRUD Operations
  • Migration Operations
  • User Authentication
  • Register / Login Operations
  • Forgot Password
  • Roles Operations
  • SMTP E-Mail Sender

Build With

HTML5 CSS3 Bootstrap javascript C# MySQL .Net Visual Studio

Installation

  1. 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": "*"
    }
  2. Type the add-migration command via the Package Manager Console.

    add-migration DbCreateFirst
    
  3. Type the update-database command via the Package Manager Console.

    update-database
    
  4. 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");

Contact Information

You can reach out to me using the following contact details:

Email

LinkedIn

I'm always open to development and collaboration. Feel free to reach out to me!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published