Skip to content

MhSaleemAlZayat/IdentityServer.dotnet8.Implementation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Identity Server – .NET 8 Implementation

This repository is a practical implementation of the Duende IdentityServer Quickstarts, based on the official guide:
👉 IdentityServer Quickstart Overview

🔗 Useful Resources

🏗️ Solution Structure

This implementation consists of three main projects:

  1. IdentityServer
    • Implements the Identity Server itself
    • Uses ASP.NET Identity for user management
    • Configured with Duende IdentityServer to issue tokens (Access, Refresh, ID tokens)
    • Backed by Entity Framework for persistence
  2. APIResource
    • An ASP.NET Core API project
    • Represents a protected resource that requires tokens issued by IdentityServer
    • Demonstrates how APIs validate tokens and enforce scopes/claims
  3. WebClient
    • An ASP.NET MVC (.NET 8) client application
    • Integrates with IdentityServer for login/logout
    • Consumes APIResource using secure access tokens

🚀 Why This Project?

This solution is designed as a reference implementation to:

  • Learn and experiment with Duende IdentityServer
  • Demonstrate how to secure APIs and clients with OAuth 2.0 / OIDC
  • Provide a starting point for building scalable, real-world identity infrastructures

🚀 Getting Started

✅ Prerequisites

  • .NET 8 SDK
  • [SQL Server / SQLite / PostgreSQL] (depending on your Entity Framework provider)
  • An IDE such as Visual Studio 2022

⚙️ Setup & Run

  1. Add IdentityServer templates for dotnet CLI
   dotnet new install Duende.Templates
  1. Clone the repository
   git clone https://github.com/MhSaleemAlZayat/IdentityServer.dotnet8.Implementation.git
  cd your-repo-name
  1. Go to appsettings.json in IdentityServer project and uncommit DefaultConnection then change connection string setting
//"DefaultConnection": "Server={YOUR-SERVER-NAME};Database=IdentityServer;User Id={YOUR-USER-ID}; Password={YOUR-PASSWORD};Trusted_Connection=False;MultipleActiveResultSets=true;Encrypt=False"
  1. Run the projects
  • Start IdentityServer first
  • Then run APIResource
  • Finally, run WebClient
  1. Test the flow
  • Navigate to https://localhost:5003
  • Login via IdentityServer using ahmed or samira with P@ssw0rd password.
  • Access the protected API through the WebClient
  • Nagigate to https://localhost:5003/Home/BrowseEmployees to browse the randome employees.

About

IdentityServer dotnet8 Implementation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published