Home › Entra ID › AADSTS90002

Entra ID · AADSTS90002 · Microsoft 365 / Entra ID

Entra ID AADSTS90002 Error in Microsoft 365

Tenant not found due to incorrect tenant identifier; fix by updating application configuration.

Error Details

FactValueSourceNote
Exact error stringAADSTS90002: Tenant not found. Check to make sure you have the correct tenant ID and are signing in to the correct national cloud.Entra admin center > Monitoring > Sign-in logs-> Error code 90002
Affected build rangeMicrosoft 365 / Entra IDProduct documentation-
Registry key or OMA-URI involved---
Relevant service/endpoint URLlogin.microsoftonline.com/{tenant}/oauth2/v2.0/authorizeBrowser address bar-> Failed sign-in attempt
Log line signatureAADSTS90002: Tenant not found.Entra admin center > Monitoring > Sign-in logs-

Log Files to Check

What This Error Actually Means

AADSTS90002 is an error code raised by Microsoft Entra ID during OAuth 2.0 token requests when the tenant identifier provided in the authority URL does not correspond to a valid Microsoft Entra tenant. The component responsible for this validation is the Azure AD authentication service, which checks the validity of the tenant identifier against its internal database before proceeding with the sign-in process or other operations that require tenant verification. This error can occur during various scenarios such as user sign-ins, API calls requiring tenant context, and application registrations that are tied to specific tenants. The exact error string is "AADSTS90002: Tenant not found. Check to make sure you have the correct tenant ID and are signing in to the correct national cloud."

Affected Versions and Scope

This issue affects Microsoft 365 / Entra ID environments where OAuth 2.0 token requests are made with an incorrect or invalid tenant identifier. It is important to note that this error does not occur across all versions of Microsoft products; it specifically targets configurations involving Entra ID for authentication purposes. The scope includes any application or service attempting to authenticate users or access resources through the OAuth 2.0 protocol, where the authority URL contains an incorrect tenant identifier. This can be a single-tenant app registered in a specific tenant or multi-tenant apps that should accept sign-ins from multiple tenants but are incorrectly configured.

Where To Look First: Logs and Event IDs

To diagnose AADSTS90002, start by examining the following logs: The HealthService log contains detailed information about the health of Microsoft services running on the machine, including any issues with Entra ID. The IIS logs will provide insights into failed HTTP requests related to OAuth 2.0 token acquisition. You can also check Event Viewer for specific event IDs: These events will give you clues about the nature of the authentication failure and help pinpoint whether it's related to a misconfigured tenant identifier or an incorrect national cloud endpoint.

Root Causes

The root causes for AADSTS90002 can be categorized as follows:

Misconfigured Tenant Identifier in Authority URL

This occurs when the {tenant} segment of the authority URL is incorrectly specified. This could be due to a typo, using an outdated tenant ID from a deleted development environment, or mistakenly referencing a different cloud endpoint.

Incorrect National Cloud Endpoint Usage

Applications targeting specific national clouds (such as GCC High for US government customers) must use the correct login endpoint URL. Using a commercial tenant ID against a national cloud endpoint will result in this error.

Incorrect Application Registration Configuration

Single-tenant applications registered to accept sign-ins only from their own directory may encounter AADSTS90002 if accessed by users or services outside of that specific tenant.

Fix Procedure

To resolve the issue, follow these steps:
  1. Determine the correct tenant identifier. Use the Azure portal to navigate to Azure Active Directory > Overview, and locate the Tenant ID field.

  2. If you need to verify programmatically, use PowerShell:

    Connect-AzureAD
    (Get-AzureADTenantDetail).ObjectId
    
    This command retrieves the tenant's unique identifier.
  3. Update your application configuration with the correct tenant ID. This can be done in code or via app settings depending on how your application is configured:

    • For MSAL .NET, update the AzureAdOptions class to include the correct TenantId.
    • For MSAL Python/JS applications, modify the authority parameter used when constructing the PublicClientApplication.
  4. If your application is multi-tenant but restricted by issuerValidator settings in a single tenant mode, change this configuration:

    • In Entra admin center > App registrations > Authentication, update Supported account types to allow for 'Accounts in any organizational directory (Multi-Tenant)'.
  5. If the application's audience was recently changed due to a tenant recreation, modify the app registration's manifest:

    Connect-MgGraph -Scopes "Application.ReadWrite.All"
    $application = Get-MgApplication -Filter "appId eq '{AppId}'"
    $application.signInAudience = 'AzureADMyOrg'
    Set-MgApplication -Application $application
    
    This PowerShell snippet updates the signInAudience property to reflect the new tenant ID.
  6. Verify that your application is correctly configured for national cloud endpoints if applicable:

    • Login.microsoftonline.com for commercial tenants.
    • Login.microsoftonline.us for GCC High and DoD tenants.
    • Login.chinacloudapi.cn for China-based tenants.
Warning: Changing the tenant ID in your application configuration can break existing deployments if not done carefully. Ensure that all instances of your application are updated to use the new identifier.

Error Code Variants

Error CodeDescription
AADSTS90014Tenant is not registered for Microsoft Graph API.
AADSTS70001The tenant identifier provided does not match the expected format or structure.
AADSTS50029Password grant type is disabled in this directory. Ensure that password-based authentication is enabled for your tenant if required by your application.

Verification

After applying the fixes, verify the resolution of AADSTS90002 by:

Prevention

To prevent recurrence, ensure that: By following these guidelines, you can effectively address AADSTS90002 errors and maintain a robust authentication environment for your Microsoft 365 / Entra ID deployments.

Sources & References

Related Guides

Get new error code fixes by email

Product-specific solutions for Intune, Autopilot, SCCM and Entra ID — straight to your inbox. No spam.