Skip to main content

ClientSecretBasicAuthenticator Class

Abblix.Oidc.Server

Abblix.Oidc.Server.Features.ClientAuthentication

ClientSecretBasicAuthenticator Class

Implements an authentication of a client request by HTTP 'Authorization' header using the 'Basic' scheme. This authentication method follows the standards outlined in RFC 7617.

public class ClientSecretBasicAuthenticator : Abblix.Oidc.Server.Features.ClientAuthentication.ClientSecretAuthenticator, Abblix.Oidc.Server.Features.ClientAuthentication.IClientAuthenticator

Inheritance System.ObjectClientSecretAuthenticator → ClientSecretBasicAuthenticator

Implements IClientAuthenticator

Constructors

ClientSecretBasicAuthenticator(ILogger<ClientSecretBasicAuthenticator>, IClientInfoProvider, TimeProvider, IHashService) Constructor

Implements an authentication of a client request by HTTP 'Authorization' header using the 'Basic' scheme. This authentication method follows the standards outlined in RFC 7617.

public ClientSecretBasicAuthenticator(Microsoft.Extensions.Logging.ILogger<Abblix.Oidc.Server.Features.ClientAuthentication.ClientSecretBasicAuthenticator> logger, Abblix.Oidc.Server.Features.ClientInformation.IClientInfoProvider clientInfoProvider, System.TimeProvider clock, Abblix.Oidc.Server.Features.Hashing.IHashService hashService);

Parameters

logger Microsoft.Extensions.Logging.ILogger<ClientSecretBasicAuthenticator>
clientInfoProvider IClientInfoProvider
clock System.TimeProvider
hashService IHashService

Properties

ClientSecretBasicAuthenticator.ClientAuthenticationMethodsSupported Property

Specifies the client authentication method this authenticator supports, which is 'client_secret_basic'. This indicates that the authenticator handles client authentication using the Basic Authentication scheme, as defined in RFC 7617, where the client ID and secret are passed in the 'Authorization' header encoded in Base64 format.

public System.Collections.Generic.IEnumerable<string> ClientAuthenticationMethodsSupported { get; }

Implements ClientAuthenticationMethodsSupported

Property Value

System.Collections.Generic.IEnumerable<System.String>

Methods

ClientSecretBasicAuthenticator.TryAuthenticateClientAsync(ClientRequest) Method

Tries to authenticate a client based on the 'Basic' authentication scheme. This method extracts the Base64-encoded credentials from the 'Authorization' header of the request, decodes them, and attempts to authenticate the client using the extracted credentials. It adheres to the user-id and password format as outlined in RFC 7617, Section 2.1, where the first colon in the credentials string separates the user-id (client ID) and the password (client secret).

public System.Threading.Tasks.Task<Abblix.Oidc.Server.Features.ClientInformation.ClientInfo?> TryAuthenticateClientAsync(Abblix.Oidc.Server.Model.ClientRequest request);

Parameters

request ClientRequest

The client request containing the authentication information in the 'Authorization' header.

Implements TryAuthenticateClientAsync(ClientRequest)

Returns

System.Threading.Tasks.Task<ClientInfo>
A System.Threading.Tasks.Task representing the asynchronous operation, which upon completion will yield the authenticated ClientInfo or null if authentication fails. If the 'Authorization' header is missing, malformed, or does not follow the Basic authentication scheme, the method returns null.