Aller au contenu
Cette page n'a pas encore été traduite.

IAuthServiceJwtFormatter Interface

Serializes a JsonWebToken minted by the authorization server itself (access tokens, refresh tokens, registration access tokens, initial access tokens) into a compact JWS form (RFC 7515) using the server's signing keys, and - per an explicit ServiceJwtEncryption policy - optionally wraps the result in a JWE (RFC 7516) encrypted to the server's own encryption key.

C#
public interface IAuthServiceJwtFormatter

Derived
↳ AuthServiceJwtFormatter

Methods

IAuthServiceJwtFormatter.FormatAsync(JsonWebToken) Method

Formats and signs a JWT for use within the authentication service, applying cryptographic operations such as signing and optionally encrypting the token based on the specified requirements.

C#
System.Threading.Tasks.Task<string> FormatAsync(Abblix.Jwt.JsonWebToken token);

Parameters

token JsonWebToken

The JSON Web Token (JWT) to be formatted and signed, potentially also encrypted.

Returns

System.Threading.Tasks.Task<System.String>
A task representing the asynchronous operation, which results in the JWT formatted as a string.

IAuthServiceJwtFormatter.FormatAsync(JsonWebToken, ServiceJwtEncryption) Method

Formats and signs a JWT for use within the authentication service, and - per the supplied encryption policy - optionally encrypts it as a JWE to the server's own encryption key. The signing algorithm and pinned signing key id come from the token header, set by the issuing service.

C#
System.Threading.Tasks.Task<string> FormatAsync(Abblix.Jwt.JsonWebToken token, Abblix.Oidc.Server.Features.Tokens.Formatters.ServiceJwtEncryption encryption);

Parameters

token JsonWebToken

The JSON Web Token (JWT) to be formatted and signed, potentially also encrypted.

encryption ServiceJwtEncryption

The encryption policy: whether to encrypt, which key-management algorithm and encryption key to use, and the content-encryption algorithm.

Returns

System.Threading.Tasks.Task<System.String>
A task representing the asynchronous operation, which results in the JWT formatted as a string.