Skip to content

Files

This branch is 68 commits behind tnc1997/samples:main.

adding-jwt-bearer-authentication-to-an-aspnet-core-5-api

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Mar 26, 2022
Mar 26, 2022
Mar 26, 2022
Mar 26, 2022
Mar 26, 2022
Mar 26, 2022
Mar 26, 2022
Mar 26, 2022

Adding JWT Bearer Authentication to an ASP.NET Core 5 API

YouTube

Getting Started

  1. Generate a self-signed certificate.
    openssl req -x509 -newkey rsa:4096 -keyout localhost.key -out localhost.crt -subj "/CN=localhost" -addext "subjectAltName=DNS:localhost,DNS:api,DNS:identityserver"
    openssl pkcs12 -export -in localhost.crt -inkey localhost.key -out localhost.pfx -name "Adding JWT Bearer Authentication to an ASP.NET Core 5 API"
  2. Import the self-signed certificate.
    certutil -f -user -importpfx Root localhost.pfx
  3. Add the lines below to the hosts file.
    127.0.0.1 api
    127.0.0.1 identityserver
    
  4. Start the services.
    docker compose up --build