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

## IRefreshTokenService Interface

Issues and consumes OAuth 2\.0 refresh tokens \(RFC 6749 §6\) used to obtain renewed access
tokens without re\-prompting the user\. Implementations apply the configured absolute and
sliding expiration policies and may revoke the previous refresh token when reuse is
disallowed\.

```csharp
public interface IRefreshTokenService
```

Derived  
↳ [RefreshTokenService](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.Tokens.RefreshTokenService 'Abblix\.Oidc\.Server\.Features\.Tokens\.RefreshTokenService')
### Methods

## IRefreshTokenService\.AuthorizeByRefreshTokenAsync\(JsonWebToken\) Method {#Abblix.Oidc.Server.Features.Tokens.IRefreshTokenService.AuthorizeByRefreshTokenAsync(Abblix.Jwt.JsonWebToken)}

Reconstructs the [AuthorizedGrant](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Endpoints.Token.Interfaces.AuthorizedGrant 'Abblix\.Oidc\.Server\.Endpoints\.Token\.Interfaces\.AuthorizedGrant') represented by a previously issued refresh
token, or returns an [OidcError](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Common.OidcError 'Abblix\.Oidc\.Server\.Common\.OidcError') when the token cannot be honored\.

```csharp
System.Threading.Tasks.Task<Abblix.Utils.Result<Abblix.Oidc.Server.Endpoints.Token.Interfaces.AuthorizedGrant,Abblix.Oidc.Server.Common.OidcError>> AuthorizeByRefreshTokenAsync(Abblix.Jwt.JsonWebToken refreshToken);
```
#### Parameters

###### `refreshToken` [JsonWebToken](https://www.abblix.com/en/docs/api/abblix-jwt/Abblix.Jwt.JsonWebToken 'Abblix\.Jwt\.JsonWebToken') {#Abblix.Oidc.Server.Features.Tokens.IRefreshTokenService.AuthorizeByRefreshTokenAsync(Abblix.Jwt.JsonWebToken).refreshToken}

#### 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')[AuthorizedGrant](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Endpoints.Token.Interfaces.AuthorizedGrant 'Abblix\.Oidc\.Server\.Endpoints\.Token\.Interfaces\.AuthorizedGrant')[,](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')

## IRefreshTokenService\.CreateRefreshTokenAsync\(AuthSession, AuthorizationContext, ClientInfo, JsonWebToken\) Method {#Abblix.Oidc.Server.Features.Tokens.IRefreshTokenService.CreateRefreshTokenAsync(Abblix.Oidc.Server.Features.UserAuthentication.AuthSession,Abblix.Oidc.Server.Common.AuthorizationContext,Abblix.Oidc.Server.Features.ClientInformation.ClientInfo,Abblix.Jwt.JsonWebToken)}

Issues a refresh token for the supplied authentication session and authorization context\.
When [refreshToken](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.Tokens.IRefreshTokenService#Abblix.Oidc.Server.Features.Tokens.IRefreshTokenService.CreateRefreshTokenAsync(Abblix.Oidc.Server.Features.UserAuthentication.AuthSession,Abblix.Oidc.Server.Common.AuthorizationContext,Abblix.Oidc.Server.Features.ClientInformation.ClientInfo,Abblix.Jwt.JsonWebToken).refreshToken 'Abblix\.Oidc\.Server\.Features\.Tokens\.IRefreshTokenService\.CreateRefreshTokenAsync\(Abblix\.Oidc\.Server\.Features\.UserAuthentication\.AuthSession, Abblix\.Oidc\.Server\.Common\.AuthorizationContext, Abblix\.Oidc\.Server\.Features\.ClientInformation\.ClientInfo, Abblix\.Jwt\.JsonWebToken\)\.refreshToken') is non\-null the call represents a refresh\-token
rotation and the previous token may be revoked according to the client's policy\. Returns
`null` when expiration policies have already elapsed and no new token can be issued\.

```csharp
System.Threading.Tasks.Task<Abblix.Oidc.Server.Features.Tokens.EncodedJsonWebToken?> CreateRefreshTokenAsync(Abblix.Oidc.Server.Features.UserAuthentication.AuthSession authSession, Abblix.Oidc.Server.Common.AuthorizationContext authContext, Abblix.Oidc.Server.Features.ClientInformation.ClientInfo clientInfo, Abblix.Jwt.JsonWebToken? refreshToken);
```
#### Parameters

###### `authSession` [AuthSession](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.UserAuthentication.AuthSession 'Abblix\.Oidc\.Server\.Features\.UserAuthentication\.AuthSession') {#Abblix.Oidc.Server.Features.Tokens.IRefreshTokenService.CreateRefreshTokenAsync(Abblix.Oidc.Server.Features.UserAuthentication.AuthSession,Abblix.Oidc.Server.Common.AuthorizationContext,Abblix.Oidc.Server.Features.ClientInformation.ClientInfo,Abblix.Jwt.JsonWebToken).authSession}

###### `authContext` [AuthorizationContext](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Common.AuthorizationContext 'Abblix\.Oidc\.Server\.Common\.AuthorizationContext') {#Abblix.Oidc.Server.Features.Tokens.IRefreshTokenService.CreateRefreshTokenAsync(Abblix.Oidc.Server.Features.UserAuthentication.AuthSession,Abblix.Oidc.Server.Common.AuthorizationContext,Abblix.Oidc.Server.Features.ClientInformation.ClientInfo,Abblix.Jwt.JsonWebToken).authContext}

###### `clientInfo` [ClientInfo](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.ClientInformation.ClientInfo 'Abblix\.Oidc\.Server\.Features\.ClientInformation\.ClientInfo') {#Abblix.Oidc.Server.Features.Tokens.IRefreshTokenService.CreateRefreshTokenAsync(Abblix.Oidc.Server.Features.UserAuthentication.AuthSession,Abblix.Oidc.Server.Common.AuthorizationContext,Abblix.Oidc.Server.Features.ClientInformation.ClientInfo,Abblix.Jwt.JsonWebToken).clientInfo}

###### `refreshToken` [JsonWebToken](https://www.abblix.com/en/docs/api/abblix-jwt/Abblix.Jwt.JsonWebToken 'Abblix\.Jwt\.JsonWebToken') {#Abblix.Oidc.Server.Features.Tokens.IRefreshTokenService.CreateRefreshTokenAsync(Abblix.Oidc.Server.Features.UserAuthentication.AuthSession,Abblix.Oidc.Server.Common.AuthorizationContext,Abblix.Oidc.Server.Features.ClientInformation.ClientInfo,Abblix.Jwt.JsonWebToken).refreshToken}

#### Returns
[System\.Threading\.Tasks\.Task&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')[EncodedJsonWebToken](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.Tokens.EncodedJsonWebToken 'Abblix\.Oidc\.Server\.Features\.Tokens\.EncodedJsonWebToken')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')
