Troubleshoot AD FS Issues in Azure Active Directory and Office 365
Troubleshoot AD FS Issues in Azure Active Directory and Office 365
Troubleshoot AD FS Issues in Azure Active Directory and Office 365
365
This article discusses workflow troubleshooting for authentication issues for
federated users in Azure Active Directory or Office 365.
Symptoms
A "Sorry, but we're having trouble signing you in" error is triggered
when a federated user signs in to Office 365 in Microsoft Azure. This error
includes error codes such as 8004786C, 80041034, 80041317, 80043431,
80048163, 80045C06, 8004789A, or BAD request.
Troubleshooting workflow
Check the URI, URL, and certificate of the federation partner that's configured
by Office 365 or Azure AD.
2. After you are redirected to AD FS, the browser may throws a certificate
trust-related error, and for some clients and devices it may not let you establish
an SSL session with AD FS. To resolve this issue, follow these steps:
In AD FS 2.0:
In AD FS 2012 R2:
How to support non-SNI capable clients with Web Application Proxy and AD FS
2012 R2
<saml:AuthnContext>
<saml:AuthnContextClassRef>
urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport
</saml:AuthnContextClassRef>
</saml:AuthnContext>
The following table shows the authentication type URIs that are recognized by
AD FS for WS-Federation passive authentication.
5.
Supported SAML authentication context classes
Kerberos urn:oasis:names:tc:SAML:2.0:ac:classes:Kerberos
6.
To make sure that the authentication method is supported at AD FS level, check
the following.
AD FS 2.0
Under /adfs/ls/web.config, make sure that the entry for the authentication
type is present.
<microsoft.identityServer.web>
<localAuthenticationTypes>
<add name="Forms" page="FormsSignIn.aspx" />
<add name="Integrated" page="auth/integrated/" />
<add name="TlsClient" page="auth/sslclient/" />
<add name="Basic" page="auth/basic/" />
</localAuthenticationTypes>
AD FS 2012 R2
In the Edit Global Authentication Policy window, on the Primary tab, you
can configure settings as part of the global authentication policy. For example,
for primary authentication, you can select available authentication methods
under Extranet and Intranet.
**Make sure that the required authentication method check box is selected.
If you get to your AD FS and enter you credentials but you
cannot be authenticated, check for the following issues.
You can also collect an AD replication summary to make sure that AD changes
are being replicated correctly across all domain controllers. The repadmin
/showrepl * /csv > showrepl.csv output is helpful for checking the replication
status. For more information, see Troubleshooting Active Directory replication
problems.
There may be duplicate SPNs or an SPN that's registered under an account other
than the AD FS service account. For an AD FS Farm setup, make sure that SPN
HOST/AD FSservicename is added under the service account that's running
the AD FS service. For an AD FS stand-alone setup, where the service is running
under Network Service, the SPN must be under the server computer account
that's hosting AD FS.
Make sure that there are not duplicate SPNs for the AD FS service, as this may
cause intermittent authentication failures with AD FS. To list the SPNs,
run SETSPN L <ServiceAccount>.
When UPN is used for authentication in this scenario, the user is authenticated
against the duplicate user. Therefore, the credentials that are provided are not
validated.
You can use queries like the following to check whether there are multiple
objects in AD that have the same values for an attribute:
Make sure that the UPN on the duplicate user is renamed, so that the
authentication request with the UPN is validated against the correct objects.
4. In a scenario, where you are using your email address as the login ID in Office
365, and you enter the same email address when you are redirected to AD FS for
authentication, authentication may fail with a "NO_SUCH_USER" error in the
Audit logs. To enable AD FS to find a user for authentication by using an attribute
other than UPN or SAMaccountname, you must configure AD FS to support an
alternate login ID. For more information, see Configuring alternate login ID.
On AD FS 2012 R2
5. The AD FS service account does not have read access to on the AD FS token
that's signing the certificates private key. To add this permission, follow these
steps:
a. When you add a new Token-Signing certificate, you receive the following
warning: "Ensure that the private key for the chosen certificate is accessible
to the service account for this Federation Service on each server in the farm."
b. Click Start, click Run, type mmc.exe, and then press Enter.
c. Click File, and then click Add/Remove Snap-in.
d. Double-click Certificates.
h. Right-click your new token-signing certificate, select All Tasks, and then
select Manage Private Keys.
i. Add Read access for your AD FS 2.0 service account, and then click OK.
For AD FS 2012 R2
7. Issuance Authorization rules in the Relying Party (RP) trust may deny access
to users. On the AD FS Relying Party trust, you can configure the Issuance
Authorization rules that control whether an authenticated user should be issued
a token for a Relying Party. Administrators can use the claims that are issued to
decide whether to deny access to a user who's a member of a group that's
pulled up as a claim.
If certain federated users cannot authenticate through AD FS, you may want to
check the Issuance Authorization rules for the Office 365 RP and see whether
the Permit Access to All Users rule is configured.
If this rule is not configure, peruse the custom authorization rules to check
whether the condition in that rule evaluates "true" for the affected user. For
more information, see the following resources:
Limiting access to Office 365 services based on the location of the client
If you can authenticate from an intranet when you access the AD FS server
directly, but you cannot authenticate when you access AD FS through an AD
FS proxy, check for the following issues:
Make sure that the time on the AD FS server and the time on the proxy are in
sync. When the time on the AD FS server is off by more than five minutes from
the time on the domain controllers, authentication failures occur. When the time
on AD FS proxy is not synced with AD FS, the proxy trust is affected and broken.
Therefore, a request that comes through the AD FS proxy fails.
b. Check whether the AD FS proxy Trust with the AD FS service is working
correctly. Rerun the proxy configuration if you suspect that the proxy trust is
broken.
WSFED:
UPN: The value of this claim should match the UPN of the users in Azure AD.
ImmutableID: The value of this claim should match the sourceAnchor or
ImmutableID of the user in Azure AD.
To get the User attribute value in Azure AD, run the following command
line: Get-MsolUser UserPrincipalName <UPN>
SAML 2.0:
IDPEmail: The value of this claim should match the user principal name of the
users in Azure AD.
NAMEID: The value of this claim should match the sourceAnchor or ImmutableID
of the user in Azure AD.
For more information, see Use a SAML 2.0 identity provider to implement single
sign-on.
Examples:
This issue can occur when the UPN of a synced user is changed in AD but
without updating the online directory. In this scenario, you can either correct the
users UPN in AD (to match the related users logon name) or run the following
cmdlet to change the logon name of the related user in the Online directory:
It might also be that you are using AADsync to sync MAIL as UPN and EMPID
as SourceAnchor, but the Relying Party claim rules at the AD FS level have not
been updated to send MAIL as UPN and EMPID as ImmutableID.
This is one of the most common issues. AD FS uses the token-signing certificate
to sign the token that's sent to the user or application. The trust between the AD
FS and Office 365 is a federated trust that's based on this token-signing
certificate (for example, Office 365 verifies that the token received is signed by
using a token-signing certificate of the claim provider [the AD FS service] that it
trusts).
However, if the token-signing certificate on the AD FS is changed because of
Auto Certificate Rollover or by an admin's intervention (after or before certificate
expiry), the details of the new certificate must be updated on the Office 365
tenant for the federated domain. This may not happen automatically; it may
require an admin's intervention. When the Primary token-signing certificate on
the AD FS is different from what Office 365 knows about, the token that's issued
by AD FS is not trusted by Office 365. Therefore, the federated user is not
allowed to log on.
Office 365 or Azure AD will try to reach out to the AD FS service, assuming the
service is reachable over the public network. We try to poll the AD FS federation
metadata at regular intervals, to pull any configuration changes on AD FS,
mainly the token-signing certificate info. If this process is not working, the global
admin should receive a warning on the Office 365 portal about the token-signing
certificate expiry and about the actions that are required to update it.
You can also run the following tool to schedule a task on the AD FS server
that will monitor for the Auto-certificate rollover of the token-signing
certificate and update the Office 365 tenant automatically.
In a scenario where you have multiple TLDs (top level domains), you might have
logon issues if the Supportmultipledomain switch was not used when the RP
trust was created and updated. For more information, click here.
Sometimes during login in from a workstation to the portal (or when using
Outlook), when the user is prompted for credentials, the credentials may be
saved for the target (Office 365 or AD FS service) in the Windows Credentials
Manager (Control Panel\User Accounts\Credential Manager). This helps prevent a
credentials prompt for some time, but it may cause a problem after the user
password has changed and the credentials manager is not updated. In that
scenario, stale credentials are sent to the AD FS service, and therefore
authentication fails. Removing or updating the cached credentials, in Windows
Credential Manager may help.
When the trust between the STS/AD FS and Azure AD/Office 365 is using SAML
2.0 protocol, the Secure Hash Algorithm configured for digital signature should
be SHA1.
Error message from AD FS 2.0 when a federated user signs in to Office 365:
"There was a problem accessing the site"