Skip to content

TokenController Class

Manages OAuth 2.0 and OpenID Connect token-related endpoints, including token issuance, revocation, and introspection. Serves as the primary interface between clients and the authorization server for managing tokens' lifecycle.

C#
public class TokenController : Microsoft.AspNetCore.Mvc.ControllerBase

Inheritance System.ObjectMicrosoft.AspNetCore.Mvc.ControllerBase → TokenController

Methods

TokenController.IntrospectionAsync(IIntrospectionHandler, IIntrospectionResponseFormatter, IntrospectionRequest, ClientRequest) Method

Allows clients to query the state of a specific token, verifying its validity, active status, and other relevant metadata.

C#
public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.ActionResult> IntrospectionAsync(Abblix.Oidc.Server.Endpoints.Introspection.Interfaces.IIntrospectionHandler handler, Abblix.Oidc.Server.Mvc.Formatters.Interfaces.IIntrospectionResponseFormatter formatter, Abblix.Oidc.Server.Mvc.Model.IntrospectionRequest introspectionRequest, Abblix.Oidc.Server.Mvc.Model.ClientRequest clientRequest);

Parameters

handler IIntrospectionHandler

The service responsible for validating and processing token introspection requests.

formatter IIntrospectionResponseFormatter

The service responsible for formatting the introspection response with detailed token information.

introspectionRequest IntrospectionRequest

Details of the introspection request, including the token to be introspected.

clientRequest ClientRequest

Additional contextual information about the client making the introspection request.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.ActionResult>
A task that results in an action providing detailed information about the state of the queried token.

Remarks

Implements the OAuth 2.0 Token Introspection specification, allowing clients to verify the status of tokens securely. OAuth 2.0 Token Introspection Documentation

TokenController.RevocationAsync(IRevocationHandler, IRevocationResponseFormatter, RevocationRequest, ClientRequest) Method

Facilitates the revocation of issued tokens, enhancing security by allowing clients to invalidate tokens no longer needed or potentially compromised.

C#
public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.ActionResult> RevocationAsync(Abblix.Oidc.Server.Endpoints.Revocation.Interfaces.IRevocationHandler handler, Abblix.Oidc.Server.Mvc.Formatters.Interfaces.IRevocationResponseFormatter formatter, Abblix.Oidc.Server.Mvc.Model.RevocationRequest revocationRequest, Abblix.Oidc.Server.Mvc.Model.ClientRequest clientRequest);

Parameters

handler IRevocationHandler

The service responsible for processing token revocation requests.

formatter IRevocationResponseFormatter

The service responsible for formatting the revocation response.

revocationRequest RevocationRequest

Details of the revocation request, including the token to be revoked.

clientRequest ClientRequest

Additional contextual information about the client making the revocation request.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.ActionResult>
A task that results in an action indicating the outcome of the revocation process.

Remarks

Adheres to the OAuth 2.0 Token Revocation standard, allowing clients to manage the lifecycle of their tokens securely. OAuth 2.0 Token Revocation Documentation

TokenController.TokenAsync(ITokenHandler, ITokenResponseFormatter, TokenRequest, ClientRequest) Method

Processes token issuance requests by evaluating authorization grants and issuing access, ID and refresh tokens accordingly.

C#
public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.ActionResult<Abblix.Oidc.Server.Model.TokenResponse>> TokenAsync(Abblix.Oidc.Server.Endpoints.Token.Interfaces.ITokenHandler handler, Abblix.Oidc.Server.Mvc.Formatters.Interfaces.ITokenResponseFormatter formatter, Abblix.Oidc.Server.Mvc.Model.TokenRequest tokenRequest, Abblix.Oidc.Server.Mvc.Model.ClientRequest clientRequest);

Parameters

handler ITokenHandler

The service responsible for handling token issuance logic.

formatter ITokenResponseFormatter

The service tasked with formatting the token issuance response.

tokenRequest TokenRequest

Details of the token request, including a grant type and required parameters.

clientRequest ClientRequest

Contextual information about the client making the request.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.ActionResult<TokenResponse>>
A task that results in an action containing the token response, formatted as per OIDC specifications.

Remarks

This endpoint is central to the OAuth 2.0 and OpenID Connect framework, facilitating the secure issuance of tokens to authenticated clients. OpenID Connect Token Endpoint Documentation