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
inputGenerateTokenForMachineInputThe input parameters required to generate the token.
cancellationTokenCancellationTokenA 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
cancellationTokenCancellationToken
Returns
ReadJwtToken(string)
Reads the specified access token and returns the corresponding JwtSecurityToken.
JwtSecurityToken ReadJwtToken(string accessToken)
Parameters
accessTokenstringThe access token.
Returns
WriteJwtToken(JwtSecurityToken)
Writes the specified JWT security token and returns the corresponding access token.
string WriteJwtToken(JwtSecurityToken jwtSecurityToken)
Parameters
jwtSecurityTokenJwtSecurityTokenThe jwt security token.