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

## TokenRequestProcessor Class

Default [ITokenRequestProcessor](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Endpoints.Token.Interfaces.ITokenRequestProcessor 'Abblix\.Oidc\.Server\.Endpoints\.Token\.Interfaces\.ITokenRequestProcessor'): always issues an access token \(RFC 6749 §5\.1\),
adds a refresh token when `offline_access` is in the granted scope \(OIDC Core 1\.0 §11\),
and adds an ID token when `openid` is in scope \(OIDC Core 1\.0 §3\.1\.3\.3, with `at_hash`
computed from the issued access token\)\.

```csharp
public class TokenRequestProcessor : Abblix.Oidc.Server.Endpoints.Token.Interfaces.ITokenRequestProcessor
```

Inheritance [System\.Object](https://learn.microsoft.com/en-us/dotnet/api/system.object 'System\.Object') → TokenRequestProcessor

Implements [ITokenRequestProcessor](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Endpoints.Token.Interfaces.ITokenRequestProcessor 'Abblix\.Oidc\.Server\.Endpoints\.Token\.Interfaces\.ITokenRequestProcessor')
### Constructors

## TokenRequestProcessor\(IAccessTokenService, IRefreshTokenService, IIdentityTokenService, ITokenAuthorizationContextEvaluator\) Constructor {#Abblix.Oidc.Server.Endpoints.Token.TokenRequestProcessor.TokenRequestProcessor(Abblix.Oidc.Server.Features.Tokens.IAccessTokenService,Abblix.Oidc.Server.Features.Tokens.IRefreshTokenService,Abblix.Oidc.Server.Features.Tokens.IIdentityTokenService,Abblix.Oidc.Server.Endpoints.Token.Interfaces.ITokenAuthorizationContextEvaluator)}

Default [ITokenRequestProcessor](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Endpoints.Token.Interfaces.ITokenRequestProcessor 'Abblix\.Oidc\.Server\.Endpoints\.Token\.Interfaces\.ITokenRequestProcessor'): always issues an access token \(RFC 6749 §5\.1\),
adds a refresh token when `offline_access` is in the granted scope \(OIDC Core 1\.0 §11\),
and adds an ID token when `openid` is in scope \(OIDC Core 1\.0 §3\.1\.3\.3, with `at_hash`
computed from the issued access token\)\.

```csharp
public TokenRequestProcessor(Abblix.Oidc.Server.Features.Tokens.IAccessTokenService accessTokenService, Abblix.Oidc.Server.Features.Tokens.IRefreshTokenService refreshTokenService, Abblix.Oidc.Server.Features.Tokens.IIdentityTokenService identityTokenService, Abblix.Oidc.Server.Endpoints.Token.Interfaces.ITokenAuthorizationContextEvaluator tokenContextEvaluator);
```
#### Parameters

###### `accessTokenService` [IAccessTokenService](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.Tokens.IAccessTokenService 'Abblix\.Oidc\.Server\.Features\.Tokens\.IAccessTokenService') {#Abblix.Oidc.Server.Endpoints.Token.TokenRequestProcessor.TokenRequestProcessor(Abblix.Oidc.Server.Features.Tokens.IAccessTokenService,Abblix.Oidc.Server.Features.Tokens.IRefreshTokenService,Abblix.Oidc.Server.Features.Tokens.IIdentityTokenService,Abblix.Oidc.Server.Endpoints.Token.Interfaces.ITokenAuthorizationContextEvaluator).accessTokenService}

Issues access\-token JWTs\.

###### `refreshTokenService` [IRefreshTokenService](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.Tokens.IRefreshTokenService 'Abblix\.Oidc\.Server\.Features\.Tokens\.IRefreshTokenService') {#Abblix.Oidc.Server.Endpoints.Token.TokenRequestProcessor.TokenRequestProcessor(Abblix.Oidc.Server.Features.Tokens.IAccessTokenService,Abblix.Oidc.Server.Features.Tokens.IRefreshTokenService,Abblix.Oidc.Server.Features.Tokens.IIdentityTokenService,Abblix.Oidc.Server.Endpoints.Token.Interfaces.ITokenAuthorizationContextEvaluator).refreshTokenService}

Issues refresh\-token JWTs, rolling the previous one for refresh\-token grants\.

###### `identityTokenService` [IIdentityTokenService](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.Tokens.IIdentityTokenService 'Abblix\.Oidc\.Server\.Features\.Tokens\.IIdentityTokenService') {#Abblix.Oidc.Server.Endpoints.Token.TokenRequestProcessor.TokenRequestProcessor(Abblix.Oidc.Server.Features.Tokens.IAccessTokenService,Abblix.Oidc.Server.Features.Tokens.IRefreshTokenService,Abblix.Oidc.Server.Features.Tokens.IIdentityTokenService,Abblix.Oidc.Server.Endpoints.Token.Interfaces.ITokenAuthorizationContextEvaluator).identityTokenService}

Issues ID tokens\.

###### `tokenContextEvaluator` [ITokenAuthorizationContextEvaluator](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Endpoints.Token.Interfaces.ITokenAuthorizationContextEvaluator 'Abblix\.Oidc\.Server\.Endpoints\.Token\.Interfaces\.ITokenAuthorizationContextEvaluator') {#Abblix.Oidc.Server.Endpoints.Token.TokenRequestProcessor.TokenRequestProcessor(Abblix.Oidc.Server.Features.Tokens.IAccessTokenService,Abblix.Oidc.Server.Features.Tokens.IRefreshTokenService,Abblix.Oidc.Server.Features.Tokens.IIdentityTokenService,Abblix.Oidc.Server.Endpoints.Token.Interfaces.ITokenAuthorizationContextEvaluator).tokenContextEvaluator}

Narrows scopes/resources and computes mTLS confirmation binding\.
### Methods

## TokenRequestProcessor\.ProcessAsync\(ValidTokenRequest\) Method {#Abblix.Oidc.Server.Endpoints.Token.TokenRequestProcessor.ProcessAsync(Abblix.Oidc.Server.Endpoints.Token.Interfaces.ValidTokenRequest)}

Asynchronously processes a valid token request, determining the necessary tokens to generate based on
the request's scope and grant type\. It generates an access token for every request and, depending on the scope,
may also generate a refresh token and an ID token for OpenID Connect authentication\.

```csharp
public System.Threading.Tasks.Task<Abblix.Utils.Result<Abblix.Oidc.Server.Endpoints.Token.Interfaces.TokenIssued,Abblix.Oidc.Server.Common.OidcError>> ProcessAsync(Abblix.Oidc.Server.Endpoints.Token.Interfaces.ValidTokenRequest request);
```
#### Parameters

###### `request` [ValidTokenRequest](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Endpoints.Token.Interfaces.ValidTokenRequest 'Abblix\.Oidc\.Server\.Endpoints\.Token\.Interfaces\.ValidTokenRequest') {#Abblix.Oidc.Server.Endpoints.Token.TokenRequestProcessor.ProcessAsync(Abblix.Oidc.Server.Endpoints.Token.Interfaces.ValidTokenRequest).request}

The validated token request containing client and authorization session information\.

Implements [ProcessAsync\(ValidTokenRequest\)](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Endpoints.Token.Interfaces.ITokenRequestProcessor#Abblix.Oidc.Server.Endpoints.Token.Interfaces.ITokenRequestProcessor.ProcessAsync(Abblix.Oidc.Server.Endpoints.Token.Interfaces.ValidTokenRequest) 'Abblix\.Oidc\.Server\.Endpoints\.Token\.Interfaces\.ITokenRequestProcessor\.ProcessAsync\(Abblix\.Oidc\.Server\.Endpoints\.Token\.Interfaces\.ValidTokenRequest\)')

#### Returns
[System\.Threading\.Tasks\.Task&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')[Abblix\.Utils\.Result&lt;](https://learn.microsoft.com/en-us/dotnet/api/abblix.utils.result-2 'Abblix\.Utils\.Result\`2')[TokenIssued](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Endpoints.Token.Interfaces.TokenIssued 'Abblix\.Oidc\.Server\.Endpoints\.Token\.Interfaces\.TokenIssued')[,](https://learn.microsoft.com/en-us/dotnet/api/abblix.utils.result-2 'Abblix\.Utils\.Result\`2')[OidcError](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Common.OidcError 'Abblix\.Oidc\.Server\.Common\.OidcError')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/abblix.utils.result-2 'Abblix\.Utils\.Result\`2')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')  
A task representing the asynchronous operation, yielding a [TokenIssued](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Endpoints.Token.Interfaces.TokenIssued 'Abblix\.Oidc\.Server\.Endpoints\.Token\.Interfaces\.TokenIssued') containing
            the generated tokens, or an [OidcError](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Common.OidcError 'Abblix\.Oidc\.Server\.Common\.OidcError') if processing fails\.

### Remarks
Access tokens authorize clients for resource access; refresh tokens enable long\-lived sessions by allowing
new access tokens to be obtained without re\-authentication; ID tokens provide identity information about
the user, crucial for OpenID Connect authentication flows\. This method ensures secure and compliant token
generation\.
