This project is to support those who is new in identity & want to use **jwt** token Authentication.
Explore the docs »
View Demo coming soon
·
Report Bug
·
Request Feature
Table of Contents
First, Clone this project or fork. And make sure you have dotnet core install. This project is created 3.1. Please make sure you update the connection string in appsettings.
First, Clone this project or fork. Please run the below mentioned commands to build it properly.
- Clean
dotnet clean
- Restore dependencies
dotnet restore
- Build Project
dotnet build
Second, Add migration first then we will create database. As we are using separate project for Identity (DBContext file) . Then we need to explicitly mentioned where is our DBContext file (-c ) and what is our starting application (-s ). I want to keep migration file inside my Data/Migration folder that's why I mentioned (-o Data/Migraions). Please run below mentioned commands.
- Add Migration
dotnet ef migrations add Initial -p Identity -s Application -c ApplicationDbContext -o Data/Migraions
- Create database
dotnet ef database update -p Identity -s Application -c ApplicationDbContext
We are successfully build and create a database. Now, we can run this project. Please run following command.
- Run project with watch. Any changes no need to re-build the project
dotnet watch run
OR
- Simply Run
dotnet run
I am currently working on it. This will help to seperate the identity framework and handle user and role separately. I also added JWT token, So later if we want to change MVC application to Web API then just add identity class library and run some commands and we good to go.
ASP.NET Core Identity framework in brief. ASP.NET Core Identity framework is used to implement forms authentication. There are many options to choose from for identifying your users including Windows Authentication and all of the third-party identity providers like Google, Microsoft, Facebook, and GitHub etc
We have Identity User table where all user data will be store. But we created Application user to extend the default identity user property. Like First Name & Last Name there can be add different properties depend on the requirements. I Added only two property to give an example.
We are using here Identity Role default one. As I don't find anything which we need to modify in the defaulty Identity Role. Name and Id is enought to use role. All roles will be store inside Identity Role table.
I have created Admin role which have the permision to add update and delete role and as well as the users. There is another role called default which I will use for the normal user.
I am seeding some data by default so when you will run this application. Super admin and admin role will be automatically inserted into the database.
I am working on few things, which is a part of my roadmap for this project.
- Create Online demo for this project.
- I want to make it as a Shell so mostly 90% need login and role mininum so just use it as a shell and start create your application using it.
- User Profile
- Edit of the Role and User
- Edit and assign new role to existing user
- Many More :)
No need to create authentication from scratch, This project help you to start not from zero. It already have authentication with JWT token. You may use the MVC main application or create your own WEB API. But using identity class library, It may help you alot and this start-up and program file from main application. It have small small things which will save alot of time. Like seeding data, JWT, Role and user managment.
See the open issues for a list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request