Require oidc metadata url instead of individual values

This commit is contained in:
ThompsonNye
2024-08-04 15:32:12 +02:00
parent ba400ade05
commit 38a28113a3
3 changed files with 8 additions and 17 deletions

View File

@@ -6,11 +6,9 @@ public class JwtOptions
{
public const string SectionName = "JWT";
public string Audience { get; set; } = "";
public string ValidAudience { get; set; } = "";
public string Authority { get; set; } = "";
public string Issuer { get; set; } = "";
public string MetadataUrl { get; set; } = "";
public string? NameClaimType { get; set; }
}
@@ -19,13 +17,10 @@ public class JwtOptionsValidator : AbstractValidator<JwtOptions>
{
public JwtOptionsValidator()
{
RuleFor(x => x.Audience)
RuleFor(x => x.ValidAudience)
.NotEmpty();
RuleFor(x => x.Authority)
.NotEmpty();
RuleFor(x => x.Issuer)
RuleFor(x => x.MetadataUrl)
.NotEmpty();
}
}