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
GenerateTokenForMachineInputThe input parameters required to generate the token.
cancellationToken
CancellationTokenA 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
ReadJwtToken(string)
Reads the specified access token and returns the corresponding JwtSecurityToken.
JwtSecurityToken ReadJwtToken(string accessToken)
Parameters
accessToken
stringThe access token.
Returns
WriteJwtToken(JwtSecurityToken)
Writes the specified JWT security token and returns the corresponding access token.
string WriteJwtToken(JwtSecurityToken jwtSecurityToken)
Parameters
jwtSecurityToken
JwtSecurityTokenThe jwt security token.