Sign-in & Login Problems

Fix AADSTS50107 Sign-In Errors for a Federated Microsoft 365 Domain

Huda QurayshiHuda Qurayshi Nov 27, 2026 869 views

Question details

Users need to restore Microsoft 365 sign-in for one federated domain that returns AADSTS50107.

Fix AADSTS50107 for a Federated Microsoft 365 Domain
Product
Microsoft 365, Microsoft Entra ID, and AD FS
Device & OS
not provided
Scenario
Users in one federated domain are redirected to AD FS when signing in, while users in other domains can sign in successfully.
Observed behavior
After valid credentials are submitted, sign-in returns AADSTS50107, indicating that the federation realm object for the affected domain does not exist.
Before you start

Identify the affected domain and a working federated domain, and confirm that you have administrator access to inspect their Microsoft Entra ID and AD FS settings. Record the error timestamp and correlation ID from a failed sign-in for troubleshooting.

Solution 1Recommended

Compare Domain Federation Settings and Repair the AD FS Trust

Use Microsoft Graph PowerShell to identify differences between the affected and working domains, then investigate the federation trust.

The older MSOnline commands Get-MsolDomain and Update-MsolFederatedDomain are retired. Use Microsoft Graph to inspect the current configuration rather than relying on those commands.

Federated domains can have different expected issuer values. Do not copy settings from the working domain without validating the multi-domain AD FS configuration.

1
Connect to Microsoft Graph

Open PowerShell with the Microsoft Graph PowerShell SDK installed. Run Connect-MgGraph -Scopes "Domain.Read.All" and sign in with an account authorized to read domain settings.

2
Check both domain states

Run Get-MgDomain -DomainId "affected.example.com" and Get-MgDomain -DomainId "working.example.com". Replace the example names with your domains and check their authentication types and verification states.

3
Compare federation configurations

For each domain, run Get-MgDomainFederationConfiguration -DomainId "affected.example.com" | Format-List *. Compare the returned issuer URI and sign-in endpoints with the working domain and your expected AD FS configuration.

4
Review and repair the trust

Check how each domain was federated and whether the AD FS trust was configured for multiple domains. Use the current Microsoft guidance for managing your AD FS trust, or contact Microsoft support with the domain comparison and sign-in correlation ID before changing federation settings.

5
Test the affected domain

After the federation configuration is corrected, open a private browser window and sign in to Microsoft 365 with an affected-domain account. Confirm that the user completes sign-in without AADSTS50107.

Compare Domain Federation Settings and Repair the AD FS Trust
About the historical fix: The original resolution used Update-MsolFederatedDomain with the SupportMultipleDomain switch. Because the MSOnline module is retired, use current Microsoft guidance or support for the equivalent repair.
Free Microsoft Office alternative

Work With Office Files in WPS Office

WPS Office is a free, lightweight alternative with a familiar interface and Microsoft Office format compatibility, making it easy to move everyday document work. It does not repair Microsoft 365 federation or sign-in errors.

Open and edit Microsoft Word, Excel, and PowerPoint formatsUse familiar document, spreadsheet, and presentation toolsMove everyday file work without relying on the affected Microsoft 365 sign-inGet a lightweight office suite with a free option
microsoft office alternative - wps office

Frequently Asked Questions

What does AADSTS50107 mean in this scenario?

It indicates that the federation realm object for the affected domain does not exist. Check the domain's federation configuration and its relationship to the AD FS trust.

Why can users in other federated domains sign in?

The issue may be specific to the affected domain's federation configuration or multi-domain AD FS trust. Compare it with a working domain using Get-MgDomainFederationConfiguration.

Can I still use Update-MsolFederatedDomain with SupportMultipleDomain?

That command was used in the historical resolution, but the MSOnline module is retired. Consult current Microsoft documentation or Microsoft support for the appropriate repair.

What information should I collect before contacting Microsoft support?

Record the affected domain, a working comparison domain, the failed sign-in timestamp, and the correlation ID shown with the error. Share configuration details through an appropriate secure support channel.