So we had ADFS Proxy connected with ADFS (Install-WebApplicationProxy), both Windows Server 2019. Had to re-establish the trust, but it waits a loong time, retrying auth
AD FS Event logs
ADFS Side has event 276 with weird values:
The federation server proxy was not able to authenticate to the Federation Service. User Action Ensure that the proxy is trusted by the Federation Service. To do this, log on to the proxy computer with the host name that is identified in the certificate subject name and re-establish trust between the proxy and the Federation Service using the Install-WebApplicationProxy cmdlet.
Additional Data
Certificate details:
Subject Name: Thumbprint:
NotBefore Time:
NotAfter Time:
There are lots of thsee events as each ~20 sec proxy retries auth. However the first event generated after Install-WebApplicationProxy is 395:
The trust between the federation server proxy and the Federation Service was established successfully using the account 'example\administrator'.
Proxy trust certificate subject: CN=ADFS ProxyTrust - ADFSproxy. Proxy trust certificate thumbprint: 3F5DBD1C735A57C5FEA8C18905EE83CEAE3EA732 So obviously my credentials are correct, the cert could be delivered to ADFS. I validated it using certlm.msc - the cert is under AdfsTrustedDevices
SChannel logs
I see following event on both, ADFS and ADFS Proxy:
Event 36867:
Creating a TLS client credential.
However for ADFS Proxy there are also warnings, Event Id 36857:
The remote server has requested TLS client authentication, but no suitable client certificate could be found. An anonymous connection will be attempted. This TLS connection request may succeed or fail, depending on the server's policy settings.
AD FS Tracing
Turned on Debug log.
ADFS:
Multiple Event 107 Errors:
ProxyRequestHandler.DefaultExceptionHandler: ProxyTrust could not be verified for certificate with subject name '' and thumbprint ''.
Exception details: Exception: No client certificate associated with the request was found. StackTrace: at Microsoft.IdentityServer.Web.Proxy.TlsRequestVerificationMethod.VerifyTrustedRequest(WrappedHttpListenerContext context, String& auditInformation) at Microsoft.IdentityServer.Web.Rest.RestRequestHandler.OnGetContext(WrappedHttpListenerContext context)
Error retrieving proxy configuration. Microsoft.IdentityServer.WebHost.Proxy.ProxyTrustException: No client certificate associated with the request was found. at Microsoft.IdentityServer.Web.Proxy.TlsRequestVerificationMethod.VerifyTrustedRequest(WrappedHttpListenerContext context, String& auditInformation) at Microsoft.IdentityServer.Web.Rest.RestRequestHandler.OnGetContext(WrappedHttpListenerContext context)
TlsRequestVerificationMethod: Incoming request didnt contain a cert.
ADFS Proxy.
Event 54:
Found certificate matching thumbprint '3F5DBD1C735A57C5FEA8C18905EE83CEAE3EA732'
Event 52 Errors:
Request for configuration failed with status:ProtocolError Message: The remote server returned an error: (401) Unauthorized. Exception:System.Net.WebException: The remote server returned an error: (401) Unauthorized. at System.Net.HttpWebRequest.GetResponse() at Microsoft.IdentityServer.Management.Proxy.StsConfigurationProvider.GetStsProxyConfiguration(X509Certificate2 trustCert)
Random things tried
- Disabled TLS1.3 (not that it's a thing on 2019) https://jaapwesselius.com/2022/01/19/adfs-web-application-proxy-configuration-wizard-fails-with-trust-certificate-error/
- Enabled TLS 1.0, 1.1 (Previously only 1.2 was configured)
- .NET Registry keys for enabling strong crypto was missing. Added. + Set default TLS 1.2
- Set winHTTP default protocol to TLS1.2 using registry
- Got latest CU 2024-03 on both servers
- Checked that the generated cert on adfsproxy has private key read permissions for adfssrv, appproxyctrl and appproxysvc service accounts.
All in all seems cert gets delivered to ADFS but client auth fails.
I don't know too much internals for ADFS Proxy / Web Application Proxy - hope there is someone who can direct me how to further troubleshoot this. Now we must endure some downtime :(
P.S. If someone recommends re-establishing trust - I AM trying to do that. These events are generated as part of that process. It fails with: An error occurred while attempting to retrieve configuration data from the Federation Server. Unable to retrieve pro...
P.P.S Could it be some configuration that prevents certificates within AdfsTrustedDevices be used for client auth? P.S. ADFS ProxyTrust - ADFSproxy
cert doesn't have any enchanced key usage - but I checked with other proxy server which was working, it neither has. How does it even trust this self-signed cert? Does ADFS implicitly trust selfsigned certs within AdfsTrustedDevices?