Class BasicAuthenticationSecretParser
- Namespace
- Fdyay.IdentityServer.Validation
- Assembly
- Fdyay.IdentityServer.AspNetCore.dll
Reads client_secret_basic credentials from the Authorization header.
public sealed class BasicAuthenticationSecretParser : ISecretParser
- Inheritance
-
BasicAuthenticationSecretParser
- Implements
- Inherited Members
Constructors
BasicAuthenticationSecretParser(IOptions<IdentityServerOptions>?)
Creates the parser.
public BasicAuthenticationSecretParser(IOptions<IdentityServerOptions>? options = null)
Parameters
optionsIOptions<IdentityServerOptions>The server options, whose input length limits bound the header and each part; null holds to the defaults.
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
Null when the header is longer than a client id and secret at their limits could make it, or either part is empty or over its limit.
Exceptions
- ArgumentNullException
contextis null.