What it means
An external security challenge wasn't satisfied yet, such as a third-party MFA provider (custom controls or external authentication methods) or terms of use.
Common causes
- The user was redirected to another page or provider to complete an extra requirement, such as a third-party MFA provider, a custom control, or terms of use.
- The external challenge is still in progress. Microsoft notes that this code alone does not indicate the user failed the sign-in; the sign-in log may show that the challenge later passed or failed.
Quick checks
- Open Entra admin center → Entra ID → Monitoring & health → Sign-in logs, find the failed event, and copy the Correlation ID, date, and time.
- Read the Failure reason and Additional Details on that event. Additional Details often includes the next step.
- Check the Conditional Access tab to see which policies applied or blocked the sign-in, and the Authentication Details tab for the methods that ran and their results.
How to fix it
If you are the user
- Complete the extra prompt, terms of use, or third-party MFA page if one appears, then wait to be returned to the app.
- If the extra page never loads or loops, try another browser or a private window, then contact your admin with what you saw.
If you are an admin
- Open the sign-in log entry and read the Failure reason, Authentication details, and Conditional Access tabs to see whether the external challenge passed or failed.
- If it persists, check the external MFA provider or terms-of-use configuration, and confirm the user is enrolled or has accepted the terms.
- Treat a single 50158 in the middle of a successful sign-in as an interrupt, not a failure, unless the log shows the challenge failed.
When to escalate
Escalate if users cannot complete the external challenge after enrollment is confirmed, or a third-party MFA or terms-of-use integration is failing for many people. Include the provider name, Correlation ID, and whether the log shows the challenge passed or failed.
Official references
- Microsoft's AADSTS error code reference (opens in a new tab)
- Official lookup for AADSTS50158 (opens in a new tab)
Descriptions on this page are summarized from Microsoft’s official error reference and the troubleshooting articles linked above. Error wording can change; use the official lookup if something here does not match what you see.