ADFS Authentication Error – Detailed Troubleshooting Guide
Active Directory Federation Services (ADFS) is a Single Sign-On (SSO) authentication service that allows users to log in using Microsoft 365, SharePoint, and other enterprise applications.
When users encounter an “ADFS Authentication Error,” it means that the authentication process failed due to misconfiguration, expired tokens, network issues, or incorrect credentials.
Common Causes of ADFS Authentication Errors:
✔ Incorrect username or password (misspelled, expired, or incorrect format).
✔ ADFS server is down or unreachable due to network issues.
✔ SSL certificate expired or misconfigured on ADFS.
✔ ADFS trust relationship broken between Microsoft 365 and the ADFS server.
✔ Incorrect ADFS Federation Service URL configured.
✔ Expired or invalid tokens causing authentication failures.
✔ Conditional Access Policies blocking access.
✔ Multi-Factor Authentication (MFA) issues.
Step 1: Verify User Credentials
Before troubleshooting ADFS, ensure that the user’s credentials are correct.
How to Verify Credentials:
- Go to https://login.microsoftonline.com.
- Enter your email address and password.
- If you are redirected to your company’s ADFS login page, enter your credentials again.
- If authentication fails, reset the password and try logging in again.
If the issue is not related to credentials, proceed to check ADFS configuration.
Step 2: Check ADFS Server Availability
If the ADFS server is down, users will not be able to authenticate.
How to Check If ADFS Is Online:
- Open a web browser and go to the ADFS metadata URL:
https://<your-adfs-server>/FederationMetadata/2007-06/FederationMetadata.xml
- If the page does not load, the ADFS server might be down.
- Use the PowerShell command below on the ADFS server to check its status:
Get-AdfsProperties | Select-Object HostName, FederationServiceIdentifier
- Restart the ADFS service:
Restart-Service adfssrv
If ADFS is down, restart the server or check with your IT team.
Step 3: Verify SSL Certificate Configuration
SSL certificate issues can prevent ADFS authentication from working correctly.
How to Check SSL Certificate Expiry:
- Open PowerShell and run the command:
Get-AdfsSslCertificate
- Look for the NotAfter field to check if the certificate has expired.
- If the certificate has expired, install a new SSL certificate and update it in ADFS.
How to Update SSL Certificate in ADFS:
- Import the new certificate:
Import-Certificate -FilePath "C:\Certs\NewCert.pfx" -CertStoreLocation Cert:\LocalMachine\My
- Set the new certificate as the ADFS service certificate:
Set-AdfsSslCertificate -Thumbprint "NEW_CERT_THUMBPRINT"
Step 4: Verify ADFS Trust with Microsoft 365
If the trust relationship between ADFS and Microsoft 365 is broken, users won’t be able to log in.
How to Check Federation Trust:
- Open PowerShell and connect to Microsoft 365:
Connect-MsolService
- Verify the federation settings:
Get-MsolFederationProperty -DomainName yourdomain.com
- Check if the Federation Service Identifier matches the ADFS configuration.
How to Repair ADFS Trust with Microsoft 365:
- Run the following command to update the trust:
Update-MsolFederatedDomain -DomainName yourdomain.com
- Restart ADFS and try logging in again.
Step 5: Verify ADFS Endpoints
ADFS endpoints must be enabled for authentication to work correctly.
How to Check ADFS Endpoints:
- Open AD FS Management Console (
adfs.msc
). - Navigate to Service → Endpoints.
- Ensure the following endpoints are enabled:
/adfs/ls/
(Sign-in endpoint)/adfs/services/trust/2005/usernamemixed
(WS-Trust endpoint)
- If any of these are disabled, right-click and select Enable.
Step 6: Check Event Logs for Errors
ADFS errors are recorded in the Event Viewer.
How to Check ADFS Logs:
- Open Event Viewer (
eventvwr.msc
). - Go to Applications and Services Logs → AD FS/Admin.
- Look for error messages related to authentication.
- Common error codes:
- 364: ADFS authentication failed due to bad request.
- 342: Token validation failure.
- 102: ADFS service failed to start.
If you see errors, take appropriate action based on the error message.
Step 7: Check Network Connectivity and DNS Configuration
If ADFS is unreachable, it might be due to network or DNS issues.
How to Check Connectivity:
- Run a ping test from a client machine:
ping <your-adfs-server>
- If the ping fails, check firewall settings to allow ADFS traffic.
- Verify DNS resolution:
nslookup <your-adfs-server>
- If DNS does not resolve, update the ADFS CNAME or A record in your DNS settings.
Step 8: Check Conditional Access Policies
Conditional Access Policies in Azure AD may block ADFS logins.
How to Check Conditional Access Policies:
- Open Azure AD Admin Center: https://aad.portal.azure.com.
- Navigate to Security → Conditional Access.
- Check if any policies block legacy authentication or require MFA.
- If needed, exclude ADFS users from restrictive policies.
Step 9: Reset ADFS Authentication Settings
If all else fails, resetting the ADFS authentication settings may help.
How to Reset ADFS Authentication Settings:
- Open PowerShell as Administrator.
- Run the following command to reset authentication policies:
Set-AdfsGlobalAuthenticationPolicy -PrimaryExtranetAuthenticationProvider @("FormsAuthentication") -PrimaryIntranetAuthenticationProvider @("WindowsAuthentication")
- Restart ADFS:
Restart-Service adfssrv
Step 10: Contact IT Support or Microsoft Support
If the issue is not resolved, contact your IT support team or open a case with Microsoft Support.
Information to Provide IT Support:
✔ Exact error message received
✔ Event Log error codes (if any)
✔ ADFS Server version
✔ Steps you have already tried