Interface ITokenService
- Namespace
- Fdyay.IdentityServer.Services.Tokens
- Assembly
- Fdyay.IdentityServer.Core.dll
Creates access and identity tokens and serializes them for transport.
public interface ITokenService
Methods
CreateAccessTokenAsync(TokenCreationRequest, CancellationToken)
Builds, unsigned, the access token a request is granted: its claims, audiences, lifetime and allowed signing algorithms.
Task<Token> CreateAccessTokenAsync(TokenCreationRequest request, CancellationToken cancellationToken = default)
Parameters
requestTokenCreationRequestWhat the token is for.
cancellationTokenCancellationTokenCancels the claims lookup.
Returns
- Task<Token>
The token, ready for CreateSecurityTokenAsync(Token, CancellationToken).
CreateIdentityTokenAsync(TokenCreationRequest, CancellationToken)
Builds, unsigned, the identity token a request is granted, with the client as its audience.
Task<Token> CreateIdentityTokenAsync(TokenCreationRequest request, CancellationToken cancellationToken = default)
Parameters
requestTokenCreationRequestWhat the token is for.
cancellationTokenCancellationTokenCancels the claims and signing-key lookups.
Returns
- Task<Token>
The token, ready for CreateSecurityTokenAsync(Token, CancellationToken).
CreateSecurityTokenAsync(Token, CancellationToken)
Serializes a token to a JWT, or to an opaque handle for reference access tokens.
Task<string> CreateSecurityTokenAsync(Token token, CancellationToken cancellationToken = default)
Parameters
tokenTokencancellationTokenCancellationToken