Share via

AADSTS500208 Error when user tries to login, I am using Microsoft Entra ID (Azure AD) with MSAL authentication for my web application.

Rishav Mahajan 0 Reputation points
2026-05-04T10:38:30.41+00:00

I am using Microsoft Entra ID (Azure AD) with MSAL authentication for my web application.

Setup

  • I registered an application with Supported account types set to: All Microsoft account users.
  • I am using a CIAM authority ({tenant}.ciamlogin.com).
  • Required API permissions are configured.
  • Users are invited via Microsoft Graph API, and then they authenticate through MSAL and access my application.

Expected Behavior

  • After being invited, users should be able to log in successfully using MSAL.

Current Issues

1. Personal Microsoft Accounts Not Logging In

  • When I invite organizational users, they can log in without issues.
  • However, when I invite personal Microsoft accounts (e.g., Outlook, Hotmail) as guest users, they are unable to log in.

To handle this, I tried identifying the account type using the following endpoint:

POST https://login.microsoftonline.com/common/GetCredentialType

Based on the response:

  • If IfExistsResult is 0 or 6, I invite the user as a guest.
  • Otherwise, I create a local account in my tenant and send them a temporary password.

This approach worked for some time.

2. AADSTS500208 Error for Organizational User

  • I encountered a case where:
    • The API indicated the user should be invited as a guest.
      • The user accepted the invitation.
        • But when trying to log in, they receive the error: AADSTS500208.

Questions

  1. Why are personal Microsoft accounts failing to log in when invited as guests?
  2. Is using the GetCredentialType endpoint a reliable way to determine how to onboard users?
  3. What could be causing the AADSTS500208 error for an organizational account that was invited as a guest?
  4. Am I missing any configuration in Microsoft Entra ID, MSAL setup, or CIAM authority that could resolve these issues?
  5. Is there a recommended or official approach to handle mixed account types (personal + organizational) in this scenario?I am using Microsoft Entra ID (Azure AD) with MSAL authentication for my web application.

    Setup

  • I registered an application with Supported account types set to: All Microsoft account users.
  • I am using a CIAM authority ({tenant}.ciamlogin.com).
  • Required API permissions are configured.
  • Users are invited via Microsoft Graph API, and then they authenticate through MSAL and access my application.

    Expected Behavior

  • After being invited, users should be able to log in successfully using MSAL.

    Current Issues

    1. Personal Microsoft Accounts Not Logging In

  • When I invite organizational users, they can log in without issues.
  • However, when I invite personal Microsoft accounts (e.g., Outlook, Hotmail) as guest users, they are unable to log in. To handle this, I tried identifying the account type using the following endpoint:
       POST https://login.microsoftonline.com/common/GetCredentialType
    
    Based on the response:
    
    • If IfExistsResult is 0 or 6, I invite the user as a guest.
  • Otherwise, I create a local account in my tenant and send them a temporary password.
    This approach worked for some time.
    
    ### 2. AADSTS500208 Error for Organizational User
    
    • I encountered a case where:
  • The API indicated the user should be invited as a guest.
  • The user accepted the invitation.
  • But when trying to log in, they receive the error: AADSTS500208.

    Questions

    1. Why are personal Microsoft accounts failing to log in when invited as guests?
    2. Is using the GetCredentialType endpoint a reliable way to determine how to onboard users?
    3. What could be causing the AADSTS500208 error for an organizational account that was invited as a guest?
    4. Am I missing any configuration in Microsoft Entra ID, MSAL setup, or CIAM authority that could resolve these issues?
    5. Is there a recommended or official approach to handle mixed account types (personal + organizational) in this scenario?
Microsoft Security | Microsoft Entra | Microsoft Entra External ID

1 answer

Sort by: Most helpful
  1. Q&A Assist
    2026-05-04T10:39:07.2366667+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more
    1. Reason personal Microsoft accounts fail as guests

    For mixed account types, the sign‑in endpoint and app’s supported account type must match the account being used:

    • If the app registration is effectively single‑tenant or tied to a specific tenant endpoint like https://login.microsoftonline.com/<YourTenantNameOrID>, external users (including personal Microsoft accounts) cannot sign in directly and must exist as guests in that tenant.
    • For personal Microsoft accounts to sign in as guests, the app must be configured to support them and the correct “common/consumers/organizations” endpoints must be used.

    If the wrong endpoint is used for the account type, Entra ID will reject the sign‑in. This is the same pattern as described for AADSTS50020 when the endpoint does not match the supported account types. For example, using a tenant‑specific authority instead of organizations, common, or consumers for an app that should accept personal accounts.

    1. Reliability of GetCredentialType for onboarding decisions

    GetCredentialType is not the supported mechanism for deciding how to onboard users (guest vs local account). It is an internal credential‑discovery endpoint and not documented as an official decision point for B2B/B2C/CIAM onboarding logic.

    The supported way to control who can sign in is:

    • Configure the app registration’s signInAudience (supported account types) correctly.
    • Use the correct sign‑in authority URL in MSAL that matches that audience (for example organizations, common, or consumers as appropriate).
    • For B2B guests, ensure the user exists as a guest in the tenant and that cross‑tenant access settings allow the sign‑in.
    1. Cause of AADSTS500208 for an invited organizational guest

    From the External ID federation FAQ:

    AADSTS500208: The domain is not a valid login domain for the account type means sign‑in failed because the account type isn’t permitted to use the login URL or tenant being accessed. The fix is to verify that the correct sign‑in endpoint is being used and that the account has access to the target tenant.

    Applied to the described scenario:

    • The user is an organizational account invited as a guest.
    • The app or MSAL is likely using an authority URL that does not match the account type or tenant context (for example, a CIAM authority or tenant‑specific authority that does not accept that domain/account type for that app configuration).
    • This mismatch between:
      • app’s signInAudience,
      • the authority URL used in MSAL, and
      • the user’s account type/domain
      leads to AADSTS500208.
    1. Configuration gaps in Entra ID / MSAL / CIAM authority

    Based on the documented patterns, typical configuration issues that cause these symptoms are:

    • signInAudience not aligned with actual usage
      • If the app is effectively single‑tenant, external users cannot sign in. The fix in the general case is to ensure signInAudience is one of:
        • AzureADandPersonalMicrosoftAccount
        • AzureADMultipleOrgs
        • PersonalMicrosoftAccount
      • If it is not, the app registration must be recreated with the correct supported account type.
    • Wrong authority URL for the account type
      • For multitenant organizational accounts: use https://login.microsoftonline.com/organizations.
      • For multitenant + personal accounts: use https://login.microsoftonline.com/common.
      • For personal accounts only: use https://login.microsoftonline.com/consumers.
      • Using a tenant‑specific authority (…/<tenantId>) when expecting external org or personal accounts will block those accounts and can surface as AADSTS50020/500208.
    • External ID / federation configuration
      • When using External ID federation (for example, adding another Entra tenant as an OIDC IdP), if the issuer URI or discovery endpoints are misconfigured, the IdP will not appear or tokens will be rejected.
      • Error 40015 is raised when the external IdP configuration or returned tokens cannot be validated (issuer mismatch, wrong endpoints, missing required claims like subject or email).
    1. Recommended approach for mixed personal + organizational accounts

    The documented, supported patterns for mixed account types are:

    • Use an app registration whose signInAudience supports the desired mix:
      • AzureADandPersonalMicrosoftAccount for both organizational and personal Microsoft accounts.
    • Use the corresponding sign‑in URL in MSAL:
      • For multitenant + personal accounts: https://login.microsoftonline.com/common.
    • For B2B guests (organizational accounts from other tenants):
      • Invite them as guests in the resource tenant.
      • Ensure cross‑tenant access settings allow invitations and sign‑ins.
    • For External ID federation with Entra ID as an OIDC IdP:
      • Ensure issuer URI, discovery endpoint, redirect URIs, and scopes are correctly configured.
      • Add the IdP to the user flow, not just to the tenant.

    In this model there is no need to call GetCredentialType to decide guest vs local account. Instead, rely on:

    • Correct app registration audience (signInAudience).
    • Correct authority URL (organizations/common/consumers) in MSAL.
    • Standard B2B guest invitations and External ID configuration.

    Aligning the app’s supported account types with the correct authority URL and ensuring guests are properly provisioned in the tenant is the supported way to handle mixed personal and organizational Microsoft accounts and will prevent AADSTS500208 and related sign‑in errors.


    References:

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.