Skip to main content

JsonWebToken Class

Abblix.Jwt

Abblix.Jwt

JsonWebToken Class

Represents a JSON Web Token (JWT), a compact, URL-safe means of representing claims to be transferred between two parties. This record encapsulates the standard JWT structure, offering properties to access and manipulate the header, payload, and claims.

public record JsonWebToken : System.IEquatable<Abblix.Jwt.JsonWebToken>

Inheritance System.Object → JsonWebToken

Implements System.IEquatable<JsonWebToken>

Properties

JsonWebToken.Header Property

Represents the JWT header, containing metadata about the type of token and the algorithms used to secure it.

public Abblix.Jwt.JsonWebTokenHeader Header { get; init; }

Property Value

JsonWebTokenHeader

Remarks

The header typically includes information such as the type of token (JWT) and the signing algorithm (e.g., HS256, RS256). This property allows direct access and manipulation of these values.

JsonWebToken.Payload Property

Represents the JWT payload, containing the claims about the entity (typically, the user) and additional metadata.

public Abblix.Jwt.JsonWebTokenPayload Payload { get; init; }

Property Value

JsonWebTokenPayload

Remarks

The payload is where the claims of the JWT are stored. This includes standard claims such as issuer, subject, and expiration time, as well as custom claims as required by the application.

Methods

JsonWebToken.Deconstruct(JsonWebTokenHeader, JsonWebTokenPayload) Method

Splits the token into its header and payload components, enabling pattern-style destructuring at the call site.

public void Deconstruct(out Abblix.Jwt.JsonWebTokenHeader header, out Abblix.Jwt.JsonWebTokenPayload payload);

Parameters

header JsonWebTokenHeader

Receives the JWS/JWT header section.

payload JsonWebTokenPayload

Receives the claim-bearing payload section.