Method AuthenticateAsync
- Assembly
- MailFathom.Infrastructure.dll
AuthenticateAsync(IReadOnlyList<McpClientCertificateTrustProfile>, X509Certificate2?, CancellationToken)
Judges the certificate a connection presented.
public Task<McpClientCertificateAuthenticationResult> AuthenticateAsync(IReadOnlyList<McpClientCertificateTrustProfile> profiles, X509Certificate2? presentedCertificate, CancellationToken cancellationToken)
Parameters
profilesIReadOnlyList<McpClientCertificateTrustProfile>The trust profiles the deployment configured, in configuration order.
presentedCertificateX509Certificate2The certificate the TLS connection carried, or null when it carried none.
cancellationTokenCancellationTokenCancels the retrieval of the configured anchor material.
Returns
- Task<McpClientCertificateAuthenticationResult>
The profile whose client the certificate identified, or the reason it was refused.
Remarks
The certificate is judged as the connection supplied it. No header is read here or anywhere else: a header naming a certificate is written by whoever sent the request.
Exceptions
- ArgumentNullException
Thrown when
profilesis null.