Class JwtCreationOptions
options for creating jwt tokens
Inherited Members
Namespace: FastEndpoints.Security
Assembly: FastEndpoints.Security.dll
Syntax
public sealed class JwtCreationOptions
Constructors
JwtCreationOptions()
Declaration
public JwtCreationOptions()
Properties
AsymmetricKidGenerator
if specified, this function will be used to generate a kid
for asymmetric key generation.
the string
value returned from this function will be set on the RsaSecurityKey.RsaSecurityKey.KeyId property.
Declaration
public Func<RSA, string>? AsymmetricKidGenerator { get; set; }
Property Value
Type | Description |
---|---|
Func<RSA, string> |
Audience
the value for the 'audience' claim.
Declaration
public string? Audience { get; set; }
Property Value
Type | Description |
---|---|
string |
CompressionAlgorithm
the compression algorithm compressing the token payload.
Declaration
public string? CompressionAlgorithm { get; set; }
Property Value
Type | Description |
---|---|
string |
ExpireAt
the value of the 'expiration' claim. should be in utc. NOTE: this should be set at the time of token creation.
Declaration
public DateTime? ExpireAt { get; set; }
Property Value
Type | Description |
---|---|
DateTime? |
Issuer
the issuer
Declaration
public string? Issuer { get; set; }
Property Value
Type | Description |
---|---|
string |
KeyIsPemEncoded
specifies whether the key is pem encoded.
Declaration
public bool KeyIsPemEncoded { get; set; }
Property Value
Type | Description |
---|---|
bool |
SigningAlgorithm
security algorithm used to sign keys.
Declaration
public string SigningAlgorithm { get; set; }
Property Value
Type | Description |
---|---|
string |
Remarks
defaults to HmacSha256 for symmetric keys. don't forget to set an appropriate algorithm when changing SigningStyle to Asymmetric
SigningKey
the key used to sign jwts symmetrically or the base64 encoded private-key when jwts are signed asymmetrically.
Declaration
public string SigningKey { get; set; }
Property Value
Type | Description |
---|---|
string |
Remarks
the key can be in PEM format. make sure to set KeyIsPemEncoded to true
if the key is PEM encoded.
SigningStyle
specifies how tokens are to be signed. symmetrically or asymmetrically.
Declaration
public TokenSigningStyle SigningStyle { get; set; }
Property Value
Type | Description |
---|---|
TokenSigningStyle |
Remarks
don't forget to set an appropriate SigningAlgorithm if changing to Symmetric
User
specify the privileges of the user NOTE: this should be specified at the time of jwt creation.
Declaration
public UserPrivileges User { get; }
Property Value
Type | Description |
---|---|
UserPrivileges |