Skip to main content

ITokenHandler Interface

Abblix.Oidc.Server

Abblix.Oidc.Server.Endpoints.Token.Interfaces

ITokenHandler Interface

Defines a contract for handling OAuth 2.0 token requests, encompassing validation, processing, and issuance of tokens based on authorization grants.

public interface ITokenHandler

Derived
TokenHandler

Methods

ITokenHandler.HandleAsync(TokenRequest, ClientRequest) Method

Asynchronously handles a token request, validating the request details and, if valid, processing it to issue, renew or exchange tokens according to OAuth 2.0 and OpenID Connect standards.

System.Threading.Tasks.Task<Abblix.Utils.Result<Abblix.Oidc.Server.Endpoints.Token.Interfaces.TokenIssued,Abblix.Oidc.Server.Common.OidcError>> HandleAsync(Abblix.Oidc.Server.Model.TokenRequest tokenRequest, Abblix.Oidc.Server.Model.ClientRequest clientRequest);

Parameters

tokenRequest TokenRequest

The token request containing essential parameters such as the grant type, client credentials, and other parameters pertinent to the token issuance process.

clientRequest ClientRequest

Supplementary information about the client making the request, necessary for performing contextual validation and ensuring the request complies with security policies.

Returns

System.Threading.Tasks.Task<Abblix.Utils.Result<TokenIssued,OidcError>>
A System.Threading.Tasks.Task resulting in a TokenIssued on success — which contains the issued tokens (access token, refresh token, ID token, etc.) — or an OidcError describing the reason for request failure.

Remarks

Implementations of this interface are critical to the secure and compliant functioning of an OAuth 2.0 authorization server. They must ensure that only valid and authorized requests lead to the issuance of tokens, thereby maintaining the integrity and security of the authentication and authorization process.