Skip to content
Branch: master
Find file History
Latest commit 13aa94d Jan 9, 2020
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
ClientApp Added first draft Jan 8, 2020
Pages Added first draft Jan 8, 2020
Properties Added first draft Jan 8, 2020
AAD-React-AspNetCore.csproj Added first draft Jan 8, 2020
Program.cs Added first draft Jan 8, 2020
README.md Update README.md Jan 9, 2020
Startup.cs Added first draft Jan 8, 2020
appsettings.Development.json Added first draft Jan 8, 2020
appsettings.json Added first draft Jan 8, 2020

README.md

AAD-React-AspNetCore - How do I authenticate against Azure AD using React SPA and ASP.NET Core?

More instructions can be found here.

This sample shows how you force an authentication against Azure AD using React SPA and ASP.NET Core. You can use this project and extend it to more complex scenarios if required.

The solution uses ASP.NET Core 3.0, MSAL.JS and React SPA. Authentication was tested with a single tenant and multitenant application.

Getting started

You can just try it out or configure ith with your own Azure AD application.

Without your Azure AD application

You can already start the app. We created a multi-tenant application that is associated with that web application.

With your own Azure AD application

Register your app

  • Go to the App Registration in Azure AD
  • Press New registration
  • Specify a name and choose the desired account types (Single tenant, Multitenant) and then press Register
  • Copy the Application (client) ID (yourClientID) and Directory (tenant) ID (yourTenantID)
  • Go to Authentication

Configure Visual Studio

  • Go under ClientApp -> src -> msal -> MsalConfig.js
    • Replace the clientId value with yourClientID
    • In case you configured a single tenant application, replace common in the authority value with youTenantID
You can’t perform that action at this time.