feat(JwtSignatureHandler): Hinzugefügt für ConsumerApi.
This commit is contained in:
parent
f898d8c4a4
commit
9d35881327
@ -1,4 +1,5 @@
|
|||||||
using DigitalData.Auth.API.Config;
|
using DigitalData.Auth.API.Config;
|
||||||
|
using DigitalData.Auth.API.Dto;
|
||||||
using DigitalData.Auth.API.Services;
|
using DigitalData.Auth.API.Services;
|
||||||
using DigitalData.Core.Security;
|
using DigitalData.Core.Security;
|
||||||
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
||||||
@ -18,6 +19,11 @@ var apiParams = config.Get<AuthApiParams>() ?? throw new InvalidOperationExcepti
|
|||||||
builder.Services.Configure<AuthApiParams>(config);
|
builder.Services.Configure<AuthApiParams>(config);
|
||||||
builder.Services.AddConsumerApiServiceFromConfiguration(config);
|
builder.Services.AddConsumerApiServiceFromConfiguration(config);
|
||||||
builder.Services.AddCryptoFactory(config.GetSection("CryptParams"));
|
builder.Services.AddCryptoFactory(config.GetSection("CryptParams"));
|
||||||
|
builder.Services.AddJwtSignatureHandler<ConsumerApi>(api => new Dictionary<string, object>
|
||||||
|
{
|
||||||
|
{ JwtRegisteredClaimNames.Sub, api.Name },
|
||||||
|
{ JwtRegisteredClaimNames.Iat, DateTimeOffset.UtcNow.ToUnixTimeSeconds() }
|
||||||
|
});
|
||||||
|
|
||||||
builder.Services.AddControllers();
|
builder.Services.AddControllers();
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user