Initial endpoint configuration with authentication

This commit is contained in:
ThompsonNye
2024-08-03 18:55:04 +02:00
parent 0850a1518e
commit a1014bd009
23 changed files with 587 additions and 57 deletions

View File

@@ -0,0 +1,31 @@
using FluentValidation;
namespace Vegasco.WebApi.Authentication;
public class JwtOptions
{
public const string SectionName = "JWT";
public string Audience { get; set; } = "";
public string Authority { get; set; } = "";
public string Issuer { get; set; } = "";
public string? NameClaimType { get; set; }
}
public class JwtOptionsValidator : AbstractValidator<JwtOptions>
{
public JwtOptionsValidator()
{
RuleFor(x => x.Audience)
.NotEmpty();
RuleFor(x => x.Authority)
.NotEmpty();
RuleFor(x => x.Issuer)
.NotEmpty();
}
}