Start now →

We Shipped Broken Auth for Every Guest User — An Azure AD OAuth Post-Mortem

By Nagaraj · Published May 6, 2026 · 1 min read · Source: Level Up Coding
Blockchain
We Shipped Broken Auth for Every Guest User — An Azure AD OAuth Post-Mortem

Member-only story

Post-Mortem

We Shipped Broken Auth for Every Guest User — An Azure AD OAuth Post-Mortem

preferred_username was the wrong anchor all along

NagarajNagaraj6 min read·1 day ago

--

Press enter or click to view image in full size
Source : Nagaraj

We shipped an Azure AD auth flow that worked for employees but silently failed for every B2B guest user. A post-mortem on preferred_username, oid, and the right way to identify guest users.

The authentication system worked perfectly during quality assurance testing. The internal testers successfully signed in to their accounts which provided them with appropriate access rights to all required information. The project was successfully completed.

A B2B client reported a problem three weeks after launch because their users experienced login difficulties. They successfully logged in but received a 403 error after authentication. The user had an active session and a legitimate Azure AD account but our system identified him with incorrect identity information.

A single claim served as the main problem. The claim functioned as an email address but it did not meet the requirement because it only applied to guest users.

In This Article

  1. What preferred_username Actually Is (And Isn’t)
  2. Why Guest Users Break Email-Based Whitelists
This article was originally published on Level Up Coding and is republished here under RSS syndication for informational purposes. All rights and intellectual property remain with the original author. If you are the author and wish to have this article removed, please contact us at [email protected].

NexaPay — Accept Card Payments, Receive Crypto

No KYC · Instant Settlement · Visa, Mastercard, Apple Pay, Google Pay

Get Started →