Skip to content

A starter template for creating JWT token from ASP.NET Core API project and applying that JWT token authentication on React application

License

Notifications You must be signed in to change notification settings

foyzulkarim/rbac-react-redux-aspnetcore

Repository files navigation

Welcome to RBAC-React-Redux-ASPNETCore repository !

This is a basic implementation of role-based access control which can be fully controlled from an Admin panel instead of hard coding the permissions inside of your code. This implementation covers the scenario of a basic microservice based system where the users can be having different roles and based on their roles, their permission will be different accross both in the Client side and in the Server side.

Technology used

This repository uses a number of frameworks and libraries to work:

  • ReactJS - A JavaScript library for building user interfaces
  • ASP.NET Core API - Build secure REST APIs on any platform with C#
  • SQL Server - SQL Server 2019 Express is a free edition of SQL Server
  • MongoDB - The database for modern applications
  • Redis - The database for caching

Installation and Run

Install the dependencies and dev dependencies and start the server.

You can manually install the database servers and configure the connections string by yourself. Or you can use the below docker command to run the database automatically for you.

To up and running the database servers

$ cd .\artifacts\docker
$ docker-compose up

To run Auth server

$ cd .\server\AuthWebApplication\AuthWebApplication\
$ dotnet restore
$ dotnet watch run

Verify the deployment by navigating to your server address in your preferred browser.

https://localhost:5001/

To run Resource server

$ cd .\server\WebApplication2\WebApplication2
$ dotnet restore
$ dotnet watch run

Verify the deployment by navigating to your server address in your preferred browser.

https://localhost:5003/

To run client

$ cd .\client
$ npm install
$ npm start

Verify the deployment by navigating to your server address in your preferred browser.

http://localhost:3000/

How to run video

React Redux JWT Authentication using ASP.NET Core API

React Redux JWT Authentication using ASP.NET Core API

How to run and debug the systems within less than 3 minutes with docker compose

How to run and debug the systems within less than 3 minutes

Todos

  • Write tests
  • Add nodejs resource server

License

MIT