Keycloak SSO Integration — ASP.NET Core MVC

Enterprise authentication reference implementation where Keycloak acts as a centralized Identity Provider for an ASP.NET Core MVC application. Covers OpenID Connect Authorization Code Flow, role-based access control, claims mapping, and secure logout.

Project information

  • CategoryopenSource
  • Role

    Solo Developer

  • Key Contributions
    • Integrated Keycloak SSO with ASP.NET Core MVC using OpenID Connect.
    • Implemented role-based authorization with policy-based access control.
    • Built claims mapping from Keycloak tokens to ASP.NET Core identity claims.
    • Implemented secure global logout that invalidates both local and Keycloak sessions.
  • Architecture & Technical Decisions
    • Centralized authentication via Keycloak SSO to decouple authentication concerns from application logic
    • Implemented application-level RBAC to allow fine-grained access control across internal modules.
    • Chose Windows Task Scheduler for predictable and reliable execution in an on-premise enterprise environment.
    • Designed the system with modular boundaries to support future feature expansion and maintenance.
  • Technology Stack
    • ASP.NET Core MVC
    • C#
    • Keycloak SSO
    • OpenID Connect
    • RBAC
    • Cookie Authentication
    • Clean Architecture
  • ClientPersonal Project
  • Project date2026
  • Note:

    Open source project. Source code available on GitHub.

  • View