Class MutualTlsSecretParser
- Namespace
- Fdyay.IdentityServer.Validation
- Assembly
- Fdyay.IdentityServer.AspNetCore.dll
Reads a client certificate off the TLS connection (RFC 8705).
public sealed class MutualTlsSecretParser : ISecretParser
- Inheritance
-
MutualTlsSecretParser
- Implements
- Inherited Members
Remarks
The certificate proves possession; the client id still comes from the request, because a certificate says which key is presenting itself and not which registration it is presenting itself as.
Properties
AuthenticationMethods
The token_endpoint_auth_methods_supported values this parser implements.
public IReadOnlyCollection<string> AuthenticationMethods { get; }
Property Value
Remarks
A collection rather than one value, because how a credential is presented and what it is checked against are not the same question. RFC 8705 defines two methods that arrive identically — a certificate on the connection — and differ only in whether the registration names the certificate or the name it bears.
Methods
ParseAsync(HttpContext, CancellationToken)
Returns the credential this parser recognises, or null when the request carries none of its kind.
public Task<ParsedSecret?> ParseAsync(HttpContext context, CancellationToken cancellationToken = default)
Parameters
contextHttpContextcancellationTokenCancellationToken
Returns
Remarks
Needs both a client certificate on the connection and a client_id in the form.
Exceptions
- ArgumentNullException
contextis null.