Skip to content

Latest commit

 

History

History
50 lines (29 loc) · 2.48 KB

File metadata and controls

50 lines (29 loc) · 2.48 KB

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


Technology

This project uses the following technologies:

Installing the Template

To install the template implemented in this project, you need to follow these steps:

  1. Move to the templates-playground.
  2. Create the NuGet package by running dotnet pack in a terminal window.
  3. Install the package by running dotnet new -i ./bin/Debug/Auth0.Templates.1.0.0.nupkg.

Using the Template in .NET CLI

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.

Using the Template in Visual Studio

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:

visual-studio-project-template-list

Then, in the subsequent screen, you can provide the required parameters:

visual-studio-custom-parameters

You will get an ASP.NET web application configured with your Auth0 parameters and ready to run.