This repository contains a React SPA supported by an ASP.NET Core backend to implement authentication and authorization with Auth0 through the Backend For Frontend (BFF) pattern.
The following article describes the implementation details: Backend For Frontend Authentication Pattern with Auth0 and ASP.NET Core
- Clone the repo:
git clone https://github.com/auth0-blog/bff-auth0-dotnet.git. - Move to the
bff-auth0-dotnet/WeatherForecastAPIfolder. - Replace the
YOUR_DOMAINandYOUR_API_AUDIENCEplaceholders in theappsettings.jsonconfiguration file with the Auth0 domain and audience for your API. - Launch the API with the
dotnet runcommand. - Move to the
bff-auth0-dotnet/BackendForFrontend.Serverfolder. - Add the Auth0 credentials for your Regular Web Application to the
appsettings.jsonconfiguration file, as described in the Create an application in the Auth0 Dashboard subsection. - While in the
bff-auth0-dotnet/BackendForFrontend.Serverfolder, typedotnet runin a terminal window to launch the web application. - Point your browser to
https://localhost:7158to interactively test your application.
- .NET Core 10.0 installed on your machine.
- An Auth0 account.