Add JWT authentication.
Add: JWT authentication in Web API. Related configuration and services are added.
This commit is contained in:
@ -4,6 +4,7 @@ public record OptixServeSettings
|
||||
{
|
||||
public ApiSettings? Api { get; set; } = new();
|
||||
public DatabaseSettings? Database { get; set; } = new();
|
||||
public JwtSettings? Jwt { get; set; } = new();
|
||||
}
|
||||
|
||||
public record ApiSettings
|
||||
@ -12,6 +13,14 @@ public record ApiSettings
|
||||
public int? Port { get; set; } = 10086;
|
||||
}
|
||||
|
||||
public record JwtSettings
|
||||
{
|
||||
public string Secret { get; set; } = string.Empty;
|
||||
public string Issuer { get; set; } = "OptixServe";
|
||||
public string Audience { get; set; } = "OptixServeUsers";
|
||||
public int TokenExpirationMinutes { get; set; } = 60;
|
||||
}
|
||||
|
||||
public enum DatabaseType
|
||||
{
|
||||
Sqlite,
|
||||
|
Reference in New Issue
Block a user