This repository contains a .NET project template for creating an ASP.NET web application with Auth0 authentication.
It demonstrates how to create .NET project templates for .NET CLI and Visual Studio. Please, check out this article for more details: How to Create Your .NET Project Template
This project uses the following technologies:
To install the template implemented in this project, you need to follow these steps:
- Move to the
templates-playground
. - Create the NuGet package by running
dotnet pack
in a terminal window. - Install the package by running
dotnet new -i ./bin/Debug/Auth0.Templates.1.0.0.nupkg
.
Assumed you registered a regular web app with Auth0 (see the mentioned article for specific info), you can create a new ASP.NET web application from the template by running the following command in a terminal window:
dotnet new auth0webapp \
-o <YOUR_APPLICATION_NAME> \
-d <YOUR-AUTH0-DOMAIN> \
-c <YOUR-AUTH0-CLIENT-ID> \
-cl <YOUR-AUTH0-CLIENT-SECRET>
Replace the placeholders with the specific parameters.
Make sure you have enabled Visual Studio to show .NET CLI project templates. See the About template visibility section in the mentioned article for more details.
Assumed you registered a regular web app with Auth0 (see the mentioned article for specific info), you can create a new ASP.NET web application from the template by selecting Auth0 ASP.NET Core App from the project template list:
Then, in the subsequent screen, you can provide the required parameters:
You will get an ASP.NET web application configured with your Auth0 parameters and ready to run.