Skip to content

This .NET Core solution demonstrates a clean architectured WebAPI that is protected with IdentityServer service and consumed by three different clients.

Notifications You must be signed in to change notification settings

Ibrahim5aad/sample-house-info

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sample House Info - Containerized API with Identity Server 6

.Net Docker Nginx Postgres

Description

This .NET Core solution demonstrates a clean architectured WebAPI that is protected with IdentityServer service and consumed by three different clients:

  1. Console App, uses client credential flow.
  2. Server-side ASP.NET Core web application, uses authorization code flow.
  3. SPA ASP.NET Core Blazor WASM, uses PKCE flow

Setup

  1. Generate a self-signed certificate with a new private key.
    openssl req -x509 \
     -newkey rsa:4096 -keyout localhost.key \
     -out localhost.crt \
     -subj "/CN=localhost" \
     -addext "subjectAltName=DNS:localhost,DNS:api,DNS:identityserver,DNS:singlepageapplication,DNS:webapplication"
    openssl pkcs12 -export \
       -in localhost.crt \
       -inkey localhost.key \
       -out localhost.pfx \
       -name "Creating an IdentityServer 6 Solution"
  2. Import the self-signed certificate.
    certutil -f -user -importpfx Root localhost.pfx
  3. Add the line below to the hosts file.
    127.0.0.1 api
    127.0.0.1 identityserver
    127.0.0.1 singlepageapplication
    127.0.0.1 webapplication
    
  4. Open the console in the "Solution Items" folder and run the service containers.
    docker compose up --build

About

This .NET Core solution demonstrates a clean architectured WebAPI that is protected with IdentityServer service and consumed by three different clients.

Topics

Resources

Stars

Watchers

Forks