<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Dominic Robinson</title>
    <description>The latest articles on Forem by Dominic Robinson (@dominic_robinson_ff89e6b5).</description>
    <link>https://forem.com/dominic_robinson_ff89e6b5</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3916486%2F095fdd27-77e0-419c-95f3-0cea90cf9838.png</url>
      <title>Forem: Dominic Robinson</title>
      <link>https://forem.com/dominic_robinson_ff89e6b5</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/dominic_robinson_ff89e6b5"/>
    <language>en</language>
    <item>
      <title>[Boost]</title>
      <dc:creator>Dominic Robinson</dc:creator>
      <pubDate>Thu, 07 May 2026 19:06:18 +0000</pubDate>
      <link>https://forem.com/dominic_robinson_ff89e6b5/-49kb</link>
      <guid>https://forem.com/dominic_robinson_ff89e6b5/-49kb</guid>
      <description>&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/dominic_robinson_ff89e6b5/building-a-production-ready-aspnet-core-identity-system-with-mysql-open-source-template-hfa" class="crayons-story__hidden-navigation-link"&gt;Building a Production-Ready ASP.NET Core Identity System with MySQL&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;

          &lt;a href="/dominic_robinson_ff89e6b5" class="crayons-avatar  crayons-avatar--l  "&gt;
            &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3916486%2F095fdd27-77e0-419c-95f3-0cea90cf9838.png" alt="dominic_robinson_ff89e6b5 profile" class="crayons-avatar__image"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/dominic_robinson_ff89e6b5" class="crayons-story__secondary fw-medium m:hidden"&gt;
              Dominic Robinson
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                Dominic Robinson
                
              
              &lt;div id="story-author-preview-content-3628732" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/dominic_robinson_ff89e6b5" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&gt;
                        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3916486%2F095fdd27-77e0-419c-95f3-0cea90cf9838.png" class="crayons-avatar__image" alt=""&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;Dominic Robinson&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

          &lt;/div&gt;
          &lt;a href="https://dev.to/dominic_robinson_ff89e6b5/building-a-production-ready-aspnet-core-identity-system-with-mysql-open-source-template-hfa" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;May 7&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/dominic_robinson_ff89e6b5/building-a-production-ready-aspnet-core-identity-system-with-mysql-open-source-template-hfa" id="article-link-3628732"&gt;
          Building a Production-Ready ASP.NET Core Identity System with MySQL
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/csharp"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;csharp&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/dotnet"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;dotnet&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/opensource"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;opensource&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/security"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;security&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
          &lt;a href="https://dev.to/dominic_robinson_ff89e6b5/building-a-production-ready-aspnet-core-identity-system-with-mysql-open-source-template-hfa" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left"&gt;
            &lt;div class="multiple_reactions_aggregate"&gt;
              &lt;span class="multiple_reactions_icons_container"&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/sparkle-heart-5f9bee3767e18deb1bb725290cb151c25234768a0e9a2bd39370c382d02920cf.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
              &lt;/span&gt;
              &lt;span class="aggregate_reactions_counter"&gt;1&lt;span class="hidden s:inline"&gt; reaction&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/a&gt;
            &lt;a href="https://dev.to/dominic_robinson_ff89e6b5/building-a-production-ready-aspnet-core-identity-system-with-mysql-open-source-template-hfa#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              Comments


              &lt;span class="hidden s:inline"&gt;Add Comment&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            5 min read
          &lt;/small&gt;
            
              &lt;span class="bm-initial"&gt;
                

              &lt;/span&gt;
              &lt;span class="bm-success"&gt;
                

              &lt;/span&gt;
            
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;


</description>
      <category>backend</category>
      <category>dotnet</category>
      <category>opensource</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Building a Production-Ready ASP.NET Core Identity System with MySQL</title>
      <dc:creator>Dominic Robinson</dc:creator>
      <pubDate>Thu, 07 May 2026 18:55:32 +0000</pubDate>
      <link>https://forem.com/dominic_robinson_ff89e6b5/building-a-production-ready-aspnet-core-identity-system-with-mysql-open-source-template-hfa</link>
      <guid>https://forem.com/dominic_robinson_ff89e6b5/building-a-production-ready-aspnet-core-identity-system-with-mysql-open-source-template-hfa</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmx0bmz5sprbjp5o0cslm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmx0bmz5sprbjp5o0cslm.png" alt=" "&gt;&lt;/a&gt;&lt;br&gt;
Authentication is one of the most critical and most commonly misconfigured layers of any web application. Yet in the .NET ecosystem, many developers still build user registration and login flows from scratch — introducing inconsistencies, security gaps, and weeks of avoidable rework.&lt;/p&gt;

&lt;p&gt;To solve this, I built and open-sourced &lt;strong&gt;aspnet-core-2.1-user-registration-login-application&lt;/strong&gt;: a fully scaffolded, production-ready C# membership system built on ASP.NET Core 2.1 with MySQL as the backend — designed to serve as a reusable foundation for any web application requiring identity management.&lt;/p&gt;

&lt;p&gt;👉 &lt;strong&gt;&lt;a href="https://github.com/robinsondominic/aspnet-core-2.1-user-registration-login-application" rel="noopener noreferrer"&gt;View the Repository on GitHub&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;


&lt;h2&gt;
  
  
  The Problem: Identity Is Hard to Get Right
&lt;/h2&gt;

&lt;p&gt;Every enterprise web application needs identity. But most teams either:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Roll their own authentication — risking security vulnerabilities through improper password hashing, session mismanagement, or insecure token storage&lt;/li&gt;
&lt;li&gt;Spend days configuring ASP.NET Core Identity from scratch, fighting Entity Framework migrations, and wiring up database providers&lt;/li&gt;
&lt;li&gt;Rely on third-party SaaS identity solutions that introduce vendor lock-in and ongoing cost&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;What the .NET community has long needed is a &lt;strong&gt;clean, open, fully functional reference implementation&lt;/strong&gt; that teams can fork, configure, and ship — not documentation to read, but code to run.&lt;/p&gt;


&lt;h2&gt;
  
  
  What the Project Delivers
&lt;/h2&gt;

&lt;p&gt;This is a complete, end-to-end C# ASP.NET Core Razor Pages membership application, pre-wired with &lt;strong&gt;ASP.NET Core Identity&lt;/strong&gt; and &lt;strong&gt;MySQL&lt;/strong&gt; via Entity Framework Core. It provides an immediate, working baseline for any application requiring authenticated access.&lt;/p&gt;
&lt;h3&gt;
  
  
  Core Features
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;User Registration&lt;/strong&gt; — New users can self-register with email and password. Passwords are hashed using ASP.NET Core Identity's &lt;code&gt;PasswordHasher&lt;/code&gt;, which implements PBKDF2 with HMAC-SHA256 — industry-standard, not a custom implementation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;User Login&lt;/strong&gt; — Secure session-based authentication using encrypted cookies. The login flow validates credentials against the Identity store, handles failed attempts gracefully, and persists sessions across requests.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Forgot/Reset Password&lt;/strong&gt; — A complete password recovery flow, including token generation, email-based reset links, and secure token validation on submission. This is one of the most error-prone flows to build manually — it's done correctly here out of the box.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;User Dashboard&lt;/strong&gt; — An authenticated area accessible only to logged-in users, demonstrating route-level authorization guards using &lt;code&gt;[Authorize]&lt;/code&gt; attributes — a pattern directly transferable to any real application.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Admin Area&lt;/strong&gt; — A separate &lt;code&gt;AdminApp&lt;/code&gt; module with its own solution structure, demonstrating area-based authorization and multi-role access control separation.&lt;/p&gt;


&lt;h2&gt;
  
  
  Architecture &amp;amp; Technical Decisions
&lt;/h2&gt;
&lt;h3&gt;
  
  
  ASP.NET Core Identity + MySQL — A Non-Trivial Integration
&lt;/h3&gt;

&lt;p&gt;By default, Microsoft's Identity scaffolding assumes SQL Server. Wiring it to MySQL requires explicit configuration of the Pomelo MySQL provider for Entity Framework Core — a choice made deliberately here to widen applicability to teams running open-source database stacks, cloud-hosted MySQL (AWS RDS, Azure Database for MySQL, PlanetScale), or self-hosted environments.&lt;/p&gt;

&lt;p&gt;The connection string abstraction in &lt;code&gt;appsettings.json&lt;/code&gt; means the same codebase runs against local, staging, or production databases without code changes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"ConnectionStrings"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"DefaultConnection"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"server=127.0.0.1;port=3306;database=db-name;uid=db-user;password=db-password"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This environment-agnostic configuration is a prerequisite for CI/CD-ready, containerizable applications.&lt;/p&gt;

&lt;h3&gt;
  
  
  Entity Framework Core Migrations — Code-First Database Management
&lt;/h3&gt;

&lt;p&gt;Rather than shipping a SQL dump, the project uses EF Core's code-first migration model. The database schema is generated and versioned in C# — giving developers full schema control through source-controlled migration files.&lt;/p&gt;

&lt;p&gt;Getting started is a three-command sequence:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Step 1 — Delete the existing Migrations folder (to regenerate for your DB)&lt;/span&gt;

&lt;span class="c"&gt;# Step 2 — Generate migrations&lt;/span&gt;
PM&amp;gt; Add-Migration InitialCreate

&lt;span class="c"&gt;# Step 3 — Apply to the database&lt;/span&gt;
PM&amp;gt; Update-Database
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This approach means schema changes are trackable, reversible, and deployable as part of any standard release pipeline.&lt;/p&gt;

&lt;h3&gt;
  
  
  Razor Pages — Clean MVC Without the Overhead
&lt;/h3&gt;

&lt;p&gt;The application uses Razor Pages over the traditional MVC controller/view split — a deliberate architectural choice that co-locates page logic with its view, reduces boilerplate, and maps more directly to the feature-centric folder structure modern teams prefer.&lt;/p&gt;

&lt;p&gt;Each page has a corresponding &lt;code&gt;PageModel&lt;/code&gt; class with clearly separated &lt;code&gt;OnGet&lt;/code&gt; and &lt;code&gt;OnPost&lt;/code&gt; handlers — making the codebase readable, testable, and easy to extend.&lt;/p&gt;

&lt;h3&gt;
  
  
  Admin/User Separation via ASP.NET Core Areas
&lt;/h3&gt;

&lt;p&gt;The project separates the &lt;code&gt;AdminApp&lt;/code&gt; from the standard user-facing application using ASP.NET Core Areas — a clean pattern for multi-role systems where administrators and end users interact with entirely different surfaces of the same application, without sharing controllers, views, or routing.&lt;/p&gt;




&lt;h2&gt;
  
  
  Solution Structure
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;aspnet-core-2.1-user-registration-login-application/
├── AdminApp/               # Admin area with separate routing
│   ├── Controllers/
│   ├── Models/
│   ├── Views/
│   └── Areas/
├── .vs/                    # VS solution config
├── AdminApplication.sln    # Solution file
└── README.md
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Language breakdown:&lt;/strong&gt; C# 94.2% · HTML 5.7% — reflecting that this is principally a server-side application with Razor-rendered views, not a JavaScript-heavy SPA.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why Open Source?
&lt;/h2&gt;

&lt;p&gt;Enterprise authentication patterns should not be proprietary knowledge. The patterns implemented in this project — secure session management, EF Core migrations, area-based authorization, MySQL integration — are patterns that junior and mid-level .NET developers encounter on almost every project, yet spend significant time rediscovering.&lt;/p&gt;

&lt;p&gt;By releasing this as a reusable open-source scaffold, the goal is to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Save teams days of configuration&lt;/strong&gt; that add no business value&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Prevent common security mistakes&lt;/strong&gt; by providing a correct-by-default implementation&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Serve as a living reference&lt;/strong&gt; for best practices in ASP.NET Core identity management&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Accelerate onboarding&lt;/strong&gt; — new developers can read this codebase to understand how Identity, EF Core, and Razor Pages fit together in a real application&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The project has been starred and forked by developers globally, validating its utility as a community resource.&lt;/p&gt;




&lt;h2&gt;
  
  
  Who Should Use This
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Use Case&lt;/th&gt;
&lt;th&gt;How It Helps&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;New .NET web projects&lt;/td&gt;
&lt;td&gt;Skip identity setup, ship features faster&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Learning ASP.NET Core Identity&lt;/td&gt;
&lt;td&gt;See a complete, working implementation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MySQL + .NET integration&lt;/td&gt;
&lt;td&gt;Reference for Pomelo EF Core MySQL provider setup&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Multi-role web apps&lt;/td&gt;
&lt;td&gt;Admin/User area separation pattern&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Rapid prototyping&lt;/td&gt;
&lt;td&gt;Working auth in minutes, not days&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  Extending the Template
&lt;/h2&gt;

&lt;p&gt;The scaffold is intentionally minimal — it's a starting point, not a framework. Common extensions teams add from here include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;OAuth2 / Social Login&lt;/strong&gt; — Adding Google, GitHub, or Microsoft login via &lt;code&gt;AddAuthentication().AddGoogle()&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Two-Factor Authentication (2FA)&lt;/strong&gt; — ASP.NET Core Identity has built-in TOTP support ready to enable&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Email Verification&lt;/strong&gt; — Token-based email confirmation on registration&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Role-Based Access Control (RBAC)&lt;/strong&gt; — Extending the &lt;code&gt;[Authorize(Roles = "Admin")]&lt;/code&gt; pattern to granular permission sets&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;JWT API Authentication&lt;/strong&gt; — Adding a parallel API surface alongside the Razor Pages UI&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Get Started in 5 Minutes
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# 1. Clone the repo&lt;/span&gt;
git clone https://github.com/robinsondominic/aspnet-core-2.1-user-registration-login-application

&lt;span class="c"&gt;# 2. Open AdminApplication.sln in Visual Studio&lt;/span&gt;

&lt;span class="c"&gt;# 3. Update appsettings.json with your MySQL connection string&lt;/span&gt;

&lt;span class="c"&gt;# 4. In Package Manager Console:&lt;/span&gt;
Add-Migration InitialCreate
Update-Database

&lt;span class="c"&gt;# 5. Run the application — login and register pages are live&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Get Involved
&lt;/h2&gt;

&lt;p&gt;This is an open-source project and contributions are welcome — whether that's adding features, improving documentation, or raising issues for discussion.&lt;/p&gt;

&lt;p&gt;👉 &lt;strong&gt;&lt;a href="https://github.com/robinsondominic/aspnet-core-2.1-user-registration-login-application" rel="noopener noreferrer"&gt;aspnet-core-2.1-user-registration-login-application on GitHub&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If this saved you setup time or served as a useful reference, a ⭐ on the repo goes a long way in helping others find it.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Building .NET identity systems and have patterns worth sharing? Drop them in the comments — let's build a stronger open-source .NET community together. 👇&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;#dotnet&lt;/code&gt; &lt;code&gt;#csharp&lt;/code&gt; &lt;code&gt;#aspnetcore&lt;/code&gt; &lt;code&gt;#webdev&lt;/code&gt; &lt;code&gt;#opensource&lt;/code&gt; &lt;code&gt;#mysql&lt;/code&gt; &lt;code&gt;#authentication&lt;/code&gt; &lt;code&gt;#identity&lt;/code&gt; &lt;code&gt;#backend&lt;/code&gt; &lt;code&gt;#programming&lt;/code&gt;&lt;/p&gt;

</description>
      <category>csharp</category>
      <category>dotnet</category>
      <category>opensource</category>
      <category>security</category>
    </item>
    <item>
      <title>Automating SQL Server Database Administration with T-SQL Utility Scripts</title>
      <dc:creator>Dominic Robinson</dc:creator>
      <pubDate>Wed, 06 May 2026 18:17:53 +0000</pubDate>
      <link>https://forem.com/dominic_robinson_ff89e6b5/automating-sql-server-database-administration-with-t-sql-utility-scripts-2di6</link>
      <guid>https://forem.com/dominic_robinson_ff89e6b5/automating-sql-server-database-administration-with-t-sql-utility-scripts-2di6</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8ekx8iucfa0u50xnedlr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8ekx8iucfa0u50xnedlr.png" alt=" " width="800" height="336"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Database performance doesn't degrade overnight — it erodes quietly through fragmented indexes, bloated data files, and unchecked log growth. By the time your queries slow to a crawl, the damage is already done.&lt;/p&gt;

&lt;p&gt;To address this proactively, I built and open-sourced &lt;strong&gt;sql-database-admin-utility-scripts&lt;/strong&gt;: a focused collection of production-grade T-SQL scripts that automate the most critical — and most neglected — database administration tasks in SQL Server environments.&lt;/p&gt;

&lt;p&gt;👉 &lt;strong&gt;&lt;a href="https://github.com/robinsondominic/sql-database-admin-utilty-scripts" rel="noopener noreferrer"&gt;View the Repository on GitHub&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  The Problem: DBA Tasks That Fall Through the Cracks
&lt;/h2&gt;

&lt;p&gt;In enterprise environments, database administrators and developers are often juggling application delivery alongside infrastructure health. Routine but essential maintenance tasks — index management, file size optimization, fragmentation analysis — are frequently deferred until performance incidents occur.&lt;/p&gt;

&lt;p&gt;The consequences are real:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Fragmented indexes&lt;/strong&gt; degrade query execution plans, increasing I/O and CPU overhead&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Oversized data and log files&lt;/strong&gt; consume storage unnecessarily, raising cloud infrastructure costs&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Undetected index fragmentation&lt;/strong&gt; in columnstore indexes silently undermines analytical query performance&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;What's needed isn't just documentation of best practices — it's &lt;strong&gt;executable, reusable tooling&lt;/strong&gt; that makes doing the right thing the easy thing.&lt;/p&gt;




&lt;h2&gt;
  
  
  What the Scripts Do
&lt;/h2&gt;

&lt;p&gt;The repository provides four focused T-SQL utility scripts, each targeting a distinct operational concern:&lt;/p&gt;

&lt;h3&gt;
  
  
  🗜️ 1. Shrink Data File and Log Files
&lt;/h3&gt;

&lt;p&gt;Log files in SQL Server can grow unbounded if not managed. This script automates the safe shrinking of both data (&lt;code&gt;.mdf&lt;/code&gt;) and log (&lt;code&gt;.ldf&lt;/code&gt;) files — a task that, when done manually and ad hoc, frequently introduces risk through incorrect syntax or improper sequencing.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="c1"&gt;-- Example: Shrink log file to reclaim space&lt;/span&gt;
&lt;span class="n"&gt;DBCC&lt;/span&gt; &lt;span class="n"&gt;SHRINKFILE&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;DatabaseLog&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;⚠️ &lt;strong&gt;Note:&lt;/strong&gt; Shrinking is applied judiciously in this toolkit — targeted for log files post-backup or after bulk operations, not as routine maintenance that could cause page fragmentation.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h3&gt;
  
  
  🔄 2. Reorganize an Index
&lt;/h3&gt;

&lt;p&gt;Index reorganization is an &lt;strong&gt;online, low-impact operation&lt;/strong&gt; suited for indexes with moderate fragmentation (typically 10–30%). Unlike a full rebuild, it doesn't lock the table — making it safe to run against production workloads during business hours.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;ALTER&lt;/span&gt; &lt;span class="k"&gt;INDEX&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;IndexName&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="k"&gt;Schema&lt;/span&gt;&lt;span class="p"&gt;].[&lt;/span&gt;&lt;span class="n"&gt;TableName&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="n"&gt;REORGANIZE&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This script makes reorganization scriptable and schedulable — ready to plug into SQL Server Agent jobs or CI/CD database pipelines.&lt;/p&gt;




&lt;h3&gt;
  
  
  🔨 3. Rebuild an Index
&lt;/h3&gt;

&lt;p&gt;For heavily fragmented indexes (&amp;gt;30%), a full rebuild is necessary. This script automates index rebuilds with options for &lt;code&gt;ONLINE&lt;/code&gt; mode where supported, preserving availability during maintenance windows.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;ALTER&lt;/span&gt; &lt;span class="k"&gt;INDEX&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;IndexName&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="k"&gt;Schema&lt;/span&gt;&lt;span class="p"&gt;].[&lt;/span&gt;&lt;span class="n"&gt;TableName&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;REBUILD&lt;/span&gt; &lt;span class="k"&gt;WITH&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ONLINE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Rebuilding updates index statistics as a side effect — directly improving query optimizer decisions across the database.&lt;/p&gt;




&lt;h3&gt;
  
  
  🔍 4. Check Rowstore &amp;amp; Columnstore Index Fragmentation
&lt;/h3&gt;

&lt;p&gt;This is arguably the most analytically valuable script in the collection. Using &lt;code&gt;sys.dm_db_index_physical_stats&lt;/code&gt;, it surfaces fragmentation metrics for both &lt;strong&gt;rowstore&lt;/strong&gt; (traditional B-tree) and &lt;strong&gt;columnstore&lt;/strong&gt; (analytical) indexes — giving DBAs and engineers a clear, data-driven basis for deciding between reorganize and rebuild operations.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt;
    &lt;span class="n"&gt;OBJECT_NAME&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ips&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;object_id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;TableName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;IndexName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;ips&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;index_type_desc&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;ips&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;avg_fragmentation_in_percent&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;sys&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;dm_db_index_physical_stats&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;DB_ID&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'SAMPLED'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;ips&lt;/span&gt;
&lt;span class="k"&gt;JOIN&lt;/span&gt; &lt;span class="n"&gt;sys&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;indexes&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;ips&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;object_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;object_id&lt;/span&gt;
    &lt;span class="k"&gt;AND&lt;/span&gt; &lt;span class="n"&gt;ips&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;index_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;index_id&lt;/span&gt;
&lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;ips&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;avg_fragmentation_in_percent&lt;/span&gt; &lt;span class="k"&gt;DESC&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Columnstore index support is a deliberate inclusion — most open-source DBA toolkits focus exclusively on rowstore, leaving data warehouse and hybrid OLTP/OLAP environments underserved.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why Open Source?
&lt;/h2&gt;

&lt;p&gt;Database administration knowledge is often siloed — locked in internal runbooks, tribal knowledge, or expensive vendor tooling. By releasing these scripts publicly under an open-source model, the goal is to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Lower the barrier&lt;/strong&gt; for developers who maintain databases without dedicated DBA support&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Standardize&lt;/strong&gt; common maintenance operations across teams and organizations&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Provide a reference implementation&lt;/strong&gt; for engineers learning SQL Server internals&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The scripts are written to be readable and educational — not just functional. Every operation is intentional and can be understood, adapted, and extended by the community.&lt;/p&gt;




&lt;h2&gt;
  
  
  Practical Use Cases
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Scenario&lt;/th&gt;
&lt;th&gt;Recommended Script&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Scheduled weekly maintenance job&lt;/td&gt;
&lt;td&gt;Fragmentation Check → Reorganize or Rebuild&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Post-bulk-insert cleanup&lt;/td&gt;
&lt;td&gt;Shrink Log + Rebuild Index&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Performance incident investigation&lt;/td&gt;
&lt;td&gt;Fragmentation Check (Rowstore + Columnstore)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Storage cost optimization&lt;/td&gt;
&lt;td&gt;Shrink Data File&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Pre-migration health check&lt;/td&gt;
&lt;td&gt;Full fragmentation report&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  Who This Is For
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Backend developers&lt;/strong&gt; managing their own SQL Server databases&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Data engineers&lt;/strong&gt; working with hybrid OLTP/OLAP workloads&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DBAs&lt;/strong&gt; looking for scriptable, version-controlled maintenance tooling&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DevOps engineers&lt;/strong&gt; integrating database health checks into CI/CD pipelines&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  What's Next
&lt;/h2&gt;

&lt;p&gt;Planned additions to the repository include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;📊 Automated maintenance decision logic (reorganize vs. rebuild threshold evaluation)&lt;/li&gt;
&lt;li&gt;🕐 SQL Server Agent job templates for scheduling&lt;/li&gt;
&lt;li&gt;📁 Statistics update scripts&lt;/li&gt;
&lt;li&gt;🔔 Alerting queries for critical fragmentation thresholds&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Get Involved
&lt;/h2&gt;

&lt;p&gt;The repository is open for contributions. Whether you want to add scripts, improve documentation, or raise issues — all input is welcome.&lt;/p&gt;

&lt;p&gt;👉 &lt;strong&gt;&lt;a href="https://github.com/robinsondominic/sql-database-admin-utilty-scripts" rel="noopener noreferrer"&gt;sql-database-admin-utility-scripts on GitHub&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If this toolkit has saved you time or helped your team, leave a ⭐ on the repo — it helps others discover it.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;What T-SQL maintenance scripts do you rely on that aren't widely shared? Let's build a better open-source DBA toolkit together. Drop your thoughts in the comments 👇&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;#sql&lt;/code&gt; &lt;code&gt;#sqlserver&lt;/code&gt; &lt;code&gt;#database&lt;/code&gt; &lt;code&gt;#dba&lt;/code&gt; &lt;code&gt;#tsql&lt;/code&gt; &lt;code&gt;#opensource&lt;/code&gt; &lt;code&gt;#devops&lt;/code&gt; &lt;code&gt;#dataengineering&lt;/code&gt; &lt;code&gt;#backend&lt;/code&gt; &lt;code&gt;#performance&lt;/code&gt;&lt;/p&gt;

</description>
      <category>automation</category>
      <category>database</category>
      <category>opensource</category>
      <category>sql</category>
    </item>
    <item>
      <title>[Boost]</title>
      <dc:creator>Dominic Robinson</dc:creator>
      <pubDate>Wed, 06 May 2026 18:06:50 +0000</pubDate>
      <link>https://forem.com/dominic_robinson_ff89e6b5/-2486</link>
      <guid>https://forem.com/dominic_robinson_ff89e6b5/-2486</guid>
      <description>&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/dominic_robinson_ff89e6b5/stop-manually-wiring-azure-ad-auth-heres-a-secure-by-default-net-8-template-46n8" class="crayons-story__hidden-navigation-link"&gt;Stop Manually Wiring Azure AD Auth — Here's a Secure-by-Default .NET 8 Template&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;

          &lt;a href="/dominic_robinson_ff89e6b5" class="crayons-avatar  crayons-avatar--l  "&gt;
            &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3916486%2F095fdd27-77e0-419c-95f3-0cea90cf9838.png" alt="dominic_robinson_ff89e6b5 profile" class="crayons-avatar__image"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/dominic_robinson_ff89e6b5" class="crayons-story__secondary fw-medium m:hidden"&gt;
              Dominic Robinson
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                Dominic Robinson
                
              
              &lt;div id="story-author-preview-content-3622453" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/dominic_robinson_ff89e6b5" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&gt;
                        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3916486%2F095fdd27-77e0-419c-95f3-0cea90cf9838.png" class="crayons-avatar__image" alt=""&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;Dominic Robinson&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

          &lt;/div&gt;
          &lt;a href="https://dev.to/dominic_robinson_ff89e6b5/stop-manually-wiring-azure-ad-auth-heres-a-secure-by-default-net-8-template-46n8" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;May 6&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/dominic_robinson_ff89e6b5/stop-manually-wiring-azure-ad-auth-heres-a-secure-by-default-net-8-template-46n8" id="article-link-3622453"&gt;
          Stop Manually Wiring Azure AD Auth — Here's a Secure-by-Default .NET 8 Template
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag crayons-tag--filled  " href="/t/showdev"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;showdev&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/azure"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;azure&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/dotnet"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;dotnet&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/security"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;security&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
          &lt;a href="https://dev.to/dominic_robinson_ff89e6b5/stop-manually-wiring-azure-ad-auth-heres-a-secure-by-default-net-8-template-46n8" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left"&gt;
            &lt;div class="multiple_reactions_aggregate"&gt;
              &lt;span class="multiple_reactions_icons_container"&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/fire-f60e7a582391810302117f987b22a8ef04a2fe0df7e3258a5f49332df1cec71e.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
              &lt;/span&gt;
              &lt;span class="aggregate_reactions_counter"&gt;1&lt;span class="hidden s:inline"&gt; reaction&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/a&gt;
            &lt;a href="https://dev.to/dominic_robinson_ff89e6b5/stop-manually-wiring-azure-ad-auth-heres-a-secure-by-default-net-8-template-46n8#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              Comments


              &lt;span class="hidden s:inline"&gt;Add Comment&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            2 min read
          &lt;/small&gt;
            
              &lt;span class="bm-initial"&gt;
                

              &lt;/span&gt;
              &lt;span class="bm-success"&gt;
                

              &lt;/span&gt;
            
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;


</description>
    </item>
    <item>
      <title>Stop Manually Wiring Azure AD Auth — Here's a Secure-by-Default .NET 8 Template</title>
      <dc:creator>Dominic Robinson</dc:creator>
      <pubDate>Wed, 06 May 2026 18:04:15 +0000</pubDate>
      <link>https://forem.com/dominic_robinson_ff89e6b5/stop-manually-wiring-azure-ad-auth-heres-a-secure-by-default-net-8-template-46n8</link>
      <guid>https://forem.com/dominic_robinson_ff89e6b5/stop-manually-wiring-azure-ad-auth-heres-a-secure-by-default-net-8-template-46n8</guid>
      <description>&lt;p&gt;If you've ever spent days configuring OAuth 2.0 and OIDC just to get enterprise authentication working, you're not alone. It's tedious, error-prone, and honestly — it shouldn't be this hard.&lt;/p&gt;

&lt;p&gt;That's why I built and open-sourced &lt;strong&gt;AzureAdRazorLogin&lt;/strong&gt;: a ready-to-deploy C# .NET 8 Razor Pages template that handles Azure Active Directory integration out of the box.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Problem Worth Solving
&lt;/h2&gt;

&lt;p&gt;In distributed, cloud-native architectures, &lt;strong&gt;identity is the new perimeter&lt;/strong&gt;. Yet most teams still hand-roll their authentication setup — misconfiguring redirect URIs, mishandling token validation, or unknowingly introducing security drift across environments.&lt;/p&gt;

&lt;p&gt;The result? Technical debt baked into your security layer before you've shipped a single feature.&lt;/p&gt;




&lt;h2&gt;
  
  
  What AzureAdRazorLogin Does Differently
&lt;/h2&gt;

&lt;p&gt;Rather than following a tutorial and stitching together middleware, this solution gives you a &lt;strong&gt;secure baseline from line one&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  🔐 Zero-Trust by Default
&lt;/h3&gt;

&lt;p&gt;The app binds natively to Microsoft Entra ID (Azure AD) and enforces a global authorization fallback — every endpoint requires authentication unless explicitly exempted. No accidental public routes.&lt;/p&gt;

&lt;h3&gt;
  
  
  🔄 Full OIDC Lifecycle Handled
&lt;/h3&gt;

&lt;p&gt;Token acquisition, encrypted cookie session persistence, and centralized logout — including terminating the session at the Azure AD identity provider — are all wired up and working on first run.&lt;/p&gt;

&lt;h3&gt;
  
  
  ⚙️ Environment-Agnostic Config
&lt;/h3&gt;

&lt;p&gt;Tenant IDs and Client IDs are abstracted via structured &lt;code&gt;appsettings.json&lt;/code&gt; templates, making transitions between local dev, staging, and production seamless and predictable.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why This Matters for Engineering Teams
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Without This&lt;/th&gt;
&lt;th&gt;With AzureAdRazorLogin&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Days of OIDC configuration&lt;/td&gt;
&lt;td&gt;Deployed in minutes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Inconsistent security posture&lt;/td&gt;
&lt;td&gt;Deterministic, standards-aligned baseline&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Manual compliance checks&lt;/td&gt;
&lt;td&gt;Microsoft-recommended security posture built-in&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Custom boilerplate per project&lt;/td&gt;
&lt;td&gt;Reusable, versioned open-source artifact&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The template is also &lt;strong&gt;CI/CD-ready and containerization-friendly&lt;/strong&gt; — drop it into Azure App Services or AWS without any additional scaffolding.&lt;/p&gt;




&lt;h2&gt;
  
  
  Built for the Long Haul
&lt;/h2&gt;

&lt;p&gt;This isn't just a snippet — it's governed like a real open-source project:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;📄 MIT License&lt;/li&gt;
&lt;li&gt;🤝 Contributor Covenant&lt;/li&gt;
&lt;li&gt;🔀 Defined pull-request guidelines&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The goal is a living, community-maintained security baseline that evolves with the .NET ecosystem.&lt;/p&gt;




&lt;h2&gt;
  
  
  Get Started
&lt;/h2&gt;

&lt;p&gt;👉 Check out the full solution and docs: &lt;strong&gt;AzureAdRazorLogin on GitHub&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you've been burned by OIDC misconfigurations before, this is for you. Clone it, use it, contribute to it.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;How are you handling identity standardization across your .NET microservices? Drop your approach in the comments 👇&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;#dotnet&lt;/code&gt; &lt;code&gt;#azure&lt;/code&gt; &lt;code&gt;#security&lt;/code&gt; &lt;code&gt;#opensource&lt;/code&gt; &lt;code&gt;#webdev&lt;/code&gt; &lt;code&gt;#csharp&lt;/code&gt; &lt;code&gt;#zerotrust&lt;/code&gt;&lt;/p&gt;

</description>
      <category>azure</category>
      <category>dotnet</category>
      <category>security</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
