Hardcoded Authority URL in Azure AD Identity Model

AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnetPR#3410 ↗
GCI0010GCI0003BLOCKConfigurationSecurity

Context

Azure Active Directory identity model extensions PR#3410 introduced a hardcoded authority URL string in production code. Authority URLs in identity libraries must be configurable - they vary by Azure environment (global, US Government, China, Germany), by tenant, and by deployment stage. Hardcoding one means sovereign cloud deployments silently authenticate against the wrong authority, and local/staging environments cannot override it without patching the binary.

Diff evidence

src/Microsoft.IdentityModel.Tokens/Validators.cs
// Added in production identity model code:
+private string ValidateSignature(string token)
+{
+ var authority = "https://login.microsoftonline.com/"; // GCI0010: hardcoded
+ // ... validation logic using hardcoded authority
+}
[GCI0010] Hardcoding and Configuration
Location : src/.../ValidateSignature method
Summary  : Possible hardcoded configuration value ('authority' assigned a string literal).
Evidence : var authority = "https://login.microsoftonline.com/";
Why      : Hardcoded URLs and configuration values prevent environment-specific
           overrides and will silently misbehave in staging, sovereign cloud, or
           air-gapped deployments.
Action   : Inject via constructor, read from configuration, or use a constant
           defined in a dedicated configuration class.

Why it matters

Azure Active Directory is used by hundreds of thousands of enterprise applications for authentication. The identity model extensions library is the foundation of all MSAL and ADAL token validation. A hardcoded authority URL means sovereign cloud customers (US Government, Azure China, Azure Germany) who use different login endpoints cannot configure the correct authority without forking the library. Staging environments that point at a test tenant also cannot override it. The failure mode is silent - tokens validate against the wrong authority, potentially accepting tokens from unintended tenants or rejecting legitimate ones.

Detection rules