#### [Abblix\.Oidc\.Server\.Mvc](https://www.abblix.com/en/docs/api/abblix-oidc-server-mvc 'index')
### [Abblix\.Oidc\.Server\.Mvc\.Controllers](https://www.abblix.com/en/docs/api/abblix-oidc-server-mvc/Abblix.Oidc.Server.Mvc.Controllers 'Abblix\.Oidc\.Server\.Mvc\.Controllers')

## 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\.

```csharp
public class TokenController : Microsoft.AspNetCore.Mvc.ControllerBase
```

Inheritance [System\.Object](https://learn.microsoft.com/en-us/dotnet/api/system.object 'System\.Object') → [Microsoft\.AspNetCore\.Mvc\.ControllerBase](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.controllerbase 'Microsoft\.AspNetCore\.Mvc\.ControllerBase') → TokenController
### Methods

## TokenController\.IntrospectionAsync\(IIntrospectionHandler, IIntrospectionResponseFormatter, IntrospectionRequest, ClientRequest\) Method {#Abblix.Oidc.Server.Mvc.Controllers.TokenController.IntrospectionAsync(Abblix.Oidc.Server.Endpoints.Introspection.Interfaces.IIntrospectionHandler,Abblix.Oidc.Server.Mvc.Formatters.Interfaces.IIntrospectionResponseFormatter,Abblix.Oidc.Server.Mvc.Model.IntrospectionRequest,Abblix.Oidc.Server.Mvc.Model.ClientRequest)}

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

```csharp
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](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Endpoints.Introspection.Interfaces.IIntrospectionHandler 'Abblix\.Oidc\.Server\.Endpoints\.Introspection\.Interfaces\.IIntrospectionHandler') {#Abblix.Oidc.Server.Mvc.Controllers.TokenController.IntrospectionAsync(Abblix.Oidc.Server.Endpoints.Introspection.Interfaces.IIntrospectionHandler,Abblix.Oidc.Server.Mvc.Formatters.Interfaces.IIntrospectionResponseFormatter,Abblix.Oidc.Server.Mvc.Model.IntrospectionRequest,Abblix.Oidc.Server.Mvc.Model.ClientRequest).handler}

The service responsible for validating and processing token introspection requests\.

###### `formatter` [IIntrospectionResponseFormatter](https://www.abblix.com/en/docs/api/abblix-oidc-server-mvc/Abblix.Oidc.Server.Mvc.Formatters.Interfaces.IIntrospectionResponseFormatter 'Abblix\.Oidc\.Server\.Mvc\.Formatters\.Interfaces\.IIntrospectionResponseFormatter') {#Abblix.Oidc.Server.Mvc.Controllers.TokenController.IntrospectionAsync(Abblix.Oidc.Server.Endpoints.Introspection.Interfaces.IIntrospectionHandler,Abblix.Oidc.Server.Mvc.Formatters.Interfaces.IIntrospectionResponseFormatter,Abblix.Oidc.Server.Mvc.Model.IntrospectionRequest,Abblix.Oidc.Server.Mvc.Model.ClientRequest).formatter}

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

###### `introspectionRequest` [IntrospectionRequest](https://www.abblix.com/en/docs/api/abblix-oidc-server-mvc/Abblix.Oidc.Server.Mvc.Model.IntrospectionRequest 'Abblix\.Oidc\.Server\.Mvc\.Model\.IntrospectionRequest') {#Abblix.Oidc.Server.Mvc.Controllers.TokenController.IntrospectionAsync(Abblix.Oidc.Server.Endpoints.Introspection.Interfaces.IIntrospectionHandler,Abblix.Oidc.Server.Mvc.Formatters.Interfaces.IIntrospectionResponseFormatter,Abblix.Oidc.Server.Mvc.Model.IntrospectionRequest,Abblix.Oidc.Server.Mvc.Model.ClientRequest).introspectionRequest}

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

###### `clientRequest` [ClientRequest](https://www.abblix.com/en/docs/api/abblix-oidc-server-mvc/Abblix.Oidc.Server.Mvc.Model.ClientRequest 'Abblix\.Oidc\.Server\.Mvc\.Model\.ClientRequest') {#Abblix.Oidc.Server.Mvc.Controllers.TokenController.IntrospectionAsync(Abblix.Oidc.Server.Endpoints.Introspection.Interfaces.IIntrospectionHandler,Abblix.Oidc.Server.Mvc.Formatters.Interfaces.IIntrospectionResponseFormatter,Abblix.Oidc.Server.Mvc.Model.IntrospectionRequest,Abblix.Oidc.Server.Mvc.Model.ClientRequest).clientRequest}

Additional contextual information about the client making the introspection request\.

#### Returns
[System\.Threading\.Tasks\.Task&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')[Microsoft\.AspNetCore\.Mvc\.ActionResult](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.actionresult 'Microsoft\.AspNetCore\.Mvc\.ActionResult')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')  
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](https://www.rfc-editor.org/rfc/rfc7662#section-2 'https://www.rfc-editor.org/rfc/rfc7662\#section-2')

## TokenController\.RevocationAsync\(IRevocationHandler, IRevocationResponseFormatter, RevocationRequest, ClientRequest\) Method {#Abblix.Oidc.Server.Mvc.Controllers.TokenController.RevocationAsync(Abblix.Oidc.Server.Endpoints.Revocation.Interfaces.IRevocationHandler,Abblix.Oidc.Server.Mvc.Formatters.Interfaces.IRevocationResponseFormatter,Abblix.Oidc.Server.Mvc.Model.RevocationRequest,Abblix.Oidc.Server.Mvc.Model.ClientRequest)}

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

```csharp
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](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Endpoints.Revocation.Interfaces.IRevocationHandler 'Abblix\.Oidc\.Server\.Endpoints\.Revocation\.Interfaces\.IRevocationHandler') {#Abblix.Oidc.Server.Mvc.Controllers.TokenController.RevocationAsync(Abblix.Oidc.Server.Endpoints.Revocation.Interfaces.IRevocationHandler,Abblix.Oidc.Server.Mvc.Formatters.Interfaces.IRevocationResponseFormatter,Abblix.Oidc.Server.Mvc.Model.RevocationRequest,Abblix.Oidc.Server.Mvc.Model.ClientRequest).handler}

The service responsible for processing token revocation requests\.

###### `formatter` [IRevocationResponseFormatter](https://www.abblix.com/en/docs/api/abblix-oidc-server-mvc/Abblix.Oidc.Server.Mvc.Formatters.Interfaces.IRevocationResponseFormatter 'Abblix\.Oidc\.Server\.Mvc\.Formatters\.Interfaces\.IRevocationResponseFormatter') {#Abblix.Oidc.Server.Mvc.Controllers.TokenController.RevocationAsync(Abblix.Oidc.Server.Endpoints.Revocation.Interfaces.IRevocationHandler,Abblix.Oidc.Server.Mvc.Formatters.Interfaces.IRevocationResponseFormatter,Abblix.Oidc.Server.Mvc.Model.RevocationRequest,Abblix.Oidc.Server.Mvc.Model.ClientRequest).formatter}

The service responsible for formatting the revocation response\.

###### `revocationRequest` [RevocationRequest](https://www.abblix.com/en/docs/api/abblix-oidc-server-mvc/Abblix.Oidc.Server.Mvc.Model.RevocationRequest 'Abblix\.Oidc\.Server\.Mvc\.Model\.RevocationRequest') {#Abblix.Oidc.Server.Mvc.Controllers.TokenController.RevocationAsync(Abblix.Oidc.Server.Endpoints.Revocation.Interfaces.IRevocationHandler,Abblix.Oidc.Server.Mvc.Formatters.Interfaces.IRevocationResponseFormatter,Abblix.Oidc.Server.Mvc.Model.RevocationRequest,Abblix.Oidc.Server.Mvc.Model.ClientRequest).revocationRequest}

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

###### `clientRequest` [ClientRequest](https://www.abblix.com/en/docs/api/abblix-oidc-server-mvc/Abblix.Oidc.Server.Mvc.Model.ClientRequest 'Abblix\.Oidc\.Server\.Mvc\.Model\.ClientRequest') {#Abblix.Oidc.Server.Mvc.Controllers.TokenController.RevocationAsync(Abblix.Oidc.Server.Endpoints.Revocation.Interfaces.IRevocationHandler,Abblix.Oidc.Server.Mvc.Formatters.Interfaces.IRevocationResponseFormatter,Abblix.Oidc.Server.Mvc.Model.RevocationRequest,Abblix.Oidc.Server.Mvc.Model.ClientRequest).clientRequest}

Additional contextual information about the client making the revocation request\.

#### Returns
[System\.Threading\.Tasks\.Task&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')[Microsoft\.AspNetCore\.Mvc\.ActionResult](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.actionresult 'Microsoft\.AspNetCore\.Mvc\.ActionResult')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')  
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](https://www.rfc-editor.org/rfc/rfc7009#section-2 'https://www.rfc-editor.org/rfc/rfc7009\#section-2')

## TokenController\.TokenAsync\(ITokenHandler, ITokenResponseFormatter, TokenRequest, ClientRequest\) Method {#Abblix.Oidc.Server.Mvc.Controllers.TokenController.TokenAsync(Abblix.Oidc.Server.Endpoints.Token.Interfaces.ITokenHandler,Abblix.Oidc.Server.Mvc.Formatters.Interfaces.ITokenResponseFormatter,Abblix.Oidc.Server.Mvc.Model.TokenRequest,Abblix.Oidc.Server.Mvc.Model.ClientRequest)}

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

```csharp
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](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Endpoints.Token.Interfaces.ITokenHandler 'Abblix\.Oidc\.Server\.Endpoints\.Token\.Interfaces\.ITokenHandler') {#Abblix.Oidc.Server.Mvc.Controllers.TokenController.TokenAsync(Abblix.Oidc.Server.Endpoints.Token.Interfaces.ITokenHandler,Abblix.Oidc.Server.Mvc.Formatters.Interfaces.ITokenResponseFormatter,Abblix.Oidc.Server.Mvc.Model.TokenRequest,Abblix.Oidc.Server.Mvc.Model.ClientRequest).handler}

The service responsible for handling token issuance logic\.

###### `formatter` [ITokenResponseFormatter](https://www.abblix.com/en/docs/api/abblix-oidc-server-mvc/Abblix.Oidc.Server.Mvc.Formatters.Interfaces.ITokenResponseFormatter 'Abblix\.Oidc\.Server\.Mvc\.Formatters\.Interfaces\.ITokenResponseFormatter') {#Abblix.Oidc.Server.Mvc.Controllers.TokenController.TokenAsync(Abblix.Oidc.Server.Endpoints.Token.Interfaces.ITokenHandler,Abblix.Oidc.Server.Mvc.Formatters.Interfaces.ITokenResponseFormatter,Abblix.Oidc.Server.Mvc.Model.TokenRequest,Abblix.Oidc.Server.Mvc.Model.ClientRequest).formatter}

The service tasked with formatting the token issuance response\.

###### `tokenRequest` [TokenRequest](https://www.abblix.com/en/docs/api/abblix-oidc-server-mvc/Abblix.Oidc.Server.Mvc.Model.TokenRequest 'Abblix\.Oidc\.Server\.Mvc\.Model\.TokenRequest') {#Abblix.Oidc.Server.Mvc.Controllers.TokenController.TokenAsync(Abblix.Oidc.Server.Endpoints.Token.Interfaces.ITokenHandler,Abblix.Oidc.Server.Mvc.Formatters.Interfaces.ITokenResponseFormatter,Abblix.Oidc.Server.Mvc.Model.TokenRequest,Abblix.Oidc.Server.Mvc.Model.ClientRequest).tokenRequest}

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

###### `clientRequest` [ClientRequest](https://www.abblix.com/en/docs/api/abblix-oidc-server-mvc/Abblix.Oidc.Server.Mvc.Model.ClientRequest 'Abblix\.Oidc\.Server\.Mvc\.Model\.ClientRequest') {#Abblix.Oidc.Server.Mvc.Controllers.TokenController.TokenAsync(Abblix.Oidc.Server.Endpoints.Token.Interfaces.ITokenHandler,Abblix.Oidc.Server.Mvc.Formatters.Interfaces.ITokenResponseFormatter,Abblix.Oidc.Server.Mvc.Model.TokenRequest,Abblix.Oidc.Server.Mvc.Model.ClientRequest).clientRequest}

Contextual information about the client making the request\.

#### Returns
[System\.Threading\.Tasks\.Task&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')[Microsoft\.AspNetCore\.Mvc\.ActionResult&lt;](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.actionresult-1 'Microsoft\.AspNetCore\.Mvc\.ActionResult\`1')[TokenResponse](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Model.TokenResponse 'Abblix\.Oidc\.Server\.Model\.TokenResponse')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.actionresult-1 'Microsoft\.AspNetCore\.Mvc\.ActionResult\`1')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')  
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
            ](https://openid.net/specs/openid-connect-core-1_0.html#TokenEndpoint 'https://openid.net/specs/openid-connect-core-1\_0.html\#TokenEndpoint')
