Table of Contents

Interface ITokenService

Namespace
OpenSettings.Services.Interfaces
Assembly
OpenSettings.dll

Defines methods for handling and managing OpenSettings token validation and refresh functionality. This service provides functionality for checking token expiration, reading JWT tokens, and refreshing tokens.

public interface ITokenService

Methods

GenerateTokenForMachineAsync(GenerateTokenForMachineInput, CancellationToken)

Generates a new token based on the provided input parameters.

Task<IResponse<GenerateTokenResponse>> GenerateTokenForMachineAsync(GenerateTokenForMachineInput input, CancellationToken cancellationToken = default)

Parameters

input GenerateTokenForMachineInput

The input parameters required to generate the token.

cancellationToken CancellationToken

A cancellation token to cancel the operation.

Returns

Task<IResponse<GenerateTokenResponse>>

A task of Ogu.Response.Abstractions.IResponse<TData> that used to generate the token.

GetPublicJwksAsync(CancellationToken)

Task<string> GetPublicJwksAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

Task<string>

ReadJwtToken(string)

Reads the specified access token and returns the corresponding JwtSecurityToken.

JwtSecurityToken ReadJwtToken(string accessToken)

Parameters

accessToken string

The access token.

Returns

JwtSecurityToken

WriteJwtToken(JwtSecurityToken)

Writes the specified JWT security token and returns the corresponding access token.

string WriteJwtToken(JwtSecurityToken jwtSecurityToken)

Parameters

jwtSecurityToken JwtSecurityToken

The jwt security token.

Returns

string