Fix AADSTS50107 Sign-In Errors for a Federated Microsoft 365 Domain
Question details
Users need to restore Microsoft 365 sign-in for one federated domain that returns AADSTS50107.

- 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.
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.
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.
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.
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.
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.
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.
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.

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.

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.




