Ibrahim5aad / sample-house-info

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.


Languages

Language:C# 60.2%Language:CSS 13.9%Language:Less 12.9%Language:HTML 11.7%Language:Dockerfile 1.0%Language:SCSS 0.1%Language:JavaScript 0.1%