oauth fixes to be able to use vault for env vars

This commit is contained in:
Dominic Villemure
2024-06-16 11:00:40 -04:00
parent 3902511e68
commit 568a5c99ca
5 changed files with 20 additions and 27 deletions

View File

@@ -89,26 +89,26 @@ public static class DependencyInjection
jwtBearerOptions.TokenValidationParameters = new TokenValidationParameters
{
ValidateIssuer = true,
ValidIssuer = configuration["Jwt:Issuer"],
ValidIssuer = configuration["Jwt-Issuer"],
ValidateAudience = true,
ValidAudience = configuration["Jwt:Audience"],
ValidAudience = configuration["Jwt-Audience"],
ValidateLifetime = true,
IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(configuration["Jwt:Key"] ??
IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(configuration["Jwt-Key"] ??
throw new ArgumentNullException("The Jwt Key is missing.")))
};
})
.AddGoogle(GoogleDefaults.AuthenticationScheme, options =>
{
options.ClientId = configuration["Google:ClientId"] ??
options.ClientId = configuration["Google-ClientId"] ??
throw new ArgumentNullException("The Google ClientId is missing.");;
options.ClientSecret = configuration["Google:ClientSecret"] ??
options.ClientSecret = configuration["Google-ClientSecret"] ??
throw new ArgumentNullException("The Google ClientSecret is missing.");;
})
.AddFacebook(FacebookDefaults.AuthenticationScheme, options =>
{
options.ClientId = configuration["Facebook:ClientId"] ??
options.ClientId = configuration["Facebook-ClientId"] ??
throw new ArgumentNullException("The Facebook ClientId is missing.");
options.ClientSecret = configuration["Facebook:ClientSecret"] ??
options.ClientSecret = configuration["Facebook-ClientSecret"] ??
throw new ArgumentNullException("The Facebook ClientSecret is missing.");
});