Swagger documented API and Autorest generated client with Auth0
C#
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
images
swaggerapi
swaggerweb
.gitignore
LICENSE
README.md

README.md

Auth0 enabled Web App and API with Swagger

This repository consists of two Web applications, both using Auth0 to identify users.

The Web API is built on ASP.NET Core using Swagger to document its methods and models and provide an easier way to try it with a clear UI.

Swagger UI

The Web App also built on ASP.NET Core is using Autorest to auto-generate a client based on the Web API Swagger documentation.

Both applications have a configuration file that you will need to fill with your Auth0 Account details .

In the Web API appsettings.json, you need to fill your Auth0 domain and client id.

{
  "Auth0": {
    "Domain": "{YOUR_AUTH0_DOMAIN}",
    "ClientId": "{YOUR_AUTH0_CLIENTID}"
  }
}

Note: You can use appsettings.Development.json and appsettings.Production.json to store your configuration data. Make sure to configure .gitignore to not include them in your repository though

In the Web App appsettings.json, you need to fill some extra values plus the CallbackUrl, which should be equal to your Web App running domain.

{
 "Auth0": {
    "Domain": "{YOUR_AUTH0_DOMAIN}",
    "ClientId": "{YOUR_AUTH0_CLIENTID}",
    "ClientSecret": "{YOUR_AUTH0_CLIENTSECRET}",
    "CallbackUrl": "http://localhost:5001/signin-auth0"
  } 
}

Full Article

The article describing this repository and step-by-step guide can be found at Auth0's blog.