...
This commit is contained in:
@ -16,6 +16,7 @@ using Microsoft.AspNetCore.Authorization;
|
||||
using Unleash;
|
||||
using Microsoft.Extensions.Options;
|
||||
using isnd.Helpers;
|
||||
using Microsoft.IdentityModel.Tokens;
|
||||
|
||||
namespace isnd
|
||||
{
|
||||
@ -64,6 +65,7 @@ namespace isnd
|
||||
policy.Requirements.Add(new ValidApiKeyRequirement()));
|
||||
|
||||
})
|
||||
|
||||
.AddTransient<IMailer, EmailSender>()
|
||||
.AddTransient<IEmailSender, EmailSender>()
|
||||
.AddTransient<IPackageManager, PackageManager>()
|
||||
@ -80,6 +82,17 @@ namespace isnd
|
||||
return s.GetRequiredService<Microsoft.AspNetCore.Hosting.IHostingEnvironment>().CreateUnleahClient(config.Value);
|
||||
});
|
||||
|
||||
services.AddAuthentication("Bearer")
|
||||
.AddJwtBearer("Bearer", options =>
|
||||
{
|
||||
options.Authority = "https://localhost:5001";
|
||||
|
||||
options.TokenValidationParameters = new TokenValidationParameters
|
||||
{
|
||||
ValidateAudience = false
|
||||
};
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user