React (with Redux) App with Azure AD Auth and .Net Core — Starter Project

If you are developing Single Page App (SPA) in React and the backend leverages .NET Core APIs and you want to secure the backend APIs using Azure AD, https://github.com/ashishqs/react-netcore-azuread-starter can be used as your starter project.

I used Microsoft ASP.NET Core JavaScript Services as my base project and did two things:

  1. Secured the backend API Controller with Azure AD Authentication. The client needs to present valid OAuth2 bearer JWT tokens while making a request
  2. Integrated ADAL JS with React such that, if user has NOT logged in with Azure AD, (s)he would be redirected to Azure AD Login page, before user can see index.html page of the SPA

To get started, clone the repository and follow the instructions in the readme file and you should have a working React APP that would present you login page like this, before the index.html is shown:

Azure AD Sign In

Do not hesitate to leave a comment if you have any trouble using the starter project.