39 lines
No EOL
1 KiB
C#
39 lines
No EOL
1 KiB
C#
using System.Text.Json.Serialization;
|
|
|
|
namespace IdentityShroud.Core.Messages;
|
|
|
|
public class JsonWebTokenHeader
|
|
{
|
|
[JsonPropertyName("alg")]
|
|
public string Algorithm { get; set; } = "HS256";
|
|
[JsonPropertyName("typ")]
|
|
public string Type { get; set; } = "JWT";
|
|
[JsonPropertyName("kid")]
|
|
public string KeyId { get; set; }
|
|
|
|
}
|
|
|
|
public class JsonWebTokenPayload
|
|
{
|
|
[JsonPropertyName("iss")]
|
|
public string Issuer { get; set; }
|
|
[JsonPropertyName("aud")]
|
|
public string[] Audience { get; set; }
|
|
[JsonPropertyName("sub")]
|
|
public string Subject { get; set; }
|
|
[JsonPropertyName("exp")]
|
|
public long Expires { get; set; }
|
|
[JsonPropertyName("iat")]
|
|
public long IssuedAt { get; set; }
|
|
[JsonPropertyName("nbf")]
|
|
public long NotBefore { get; set; }
|
|
[JsonPropertyName("jti")]
|
|
public Guid JwtId { get; set; }
|
|
}
|
|
|
|
public class JsonWebToken
|
|
{
|
|
public JsonWebTokenHeader Header { get; set; } = new();
|
|
public JsonWebTokenPayload Payload { get; set; } = new();
|
|
public byte[] Signature { get; set; } = [];
|
|
} |