refactor(DigitalData.Auth.Client): DigitalData.Core.Security wurde auf 1.1.0 aktualisiert.
This commit is contained in:
@@ -10,6 +10,8 @@ using DigitalData.Auth.API.Dto;
|
||||
using DigitalData.Auth.API.Services.Contracts;
|
||||
using DigitalData.Auth.API.Entities;
|
||||
using DigitalData.Core.DTO;
|
||||
using DigitalData.Core.Abstractions.Security.Services;
|
||||
using DigitalData.Core.Abstractions.Security.Extensions;
|
||||
|
||||
namespace DigitalData.Auth.API.Controllers
|
||||
{
|
||||
@@ -23,7 +25,7 @@ namespace DigitalData.Auth.API.Controllers
|
||||
|
||||
private readonly AuthApiParams _apiParams;
|
||||
|
||||
private readonly ICryptoFactory _cryptoFactory;
|
||||
private readonly IAsymmetricKeyPool _keyPool;
|
||||
|
||||
private readonly ILogger<AuthController> _logger;
|
||||
|
||||
@@ -33,11 +35,11 @@ namespace DigitalData.Auth.API.Controllers
|
||||
|
||||
private readonly IConsumerService _consumerService;
|
||||
|
||||
public AuthController(IJwtSignatureHandler<UserReadDto> userSignatureHandler, IOptions<AuthApiParams> cookieParamsOptions, ICryptoFactory cryptoFactory, ILogger<AuthController> logger, IUserService userService, IDirectorySearchService dirSearchService, IConsumerService consumerService, IJwtSignatureHandler<Consumer> apiSignatureHandler)
|
||||
public AuthController(IJwtSignatureHandler<UserReadDto> userSignatureHandler, IOptions<AuthApiParams> cookieParamsOptions, IAsymmetricKeyPool keyPool, ILogger<AuthController> logger, IUserService userService, IDirectorySearchService dirSearchService, IConsumerService consumerService, IJwtSignatureHandler<Consumer> apiSignatureHandler)
|
||||
{
|
||||
_apiParams = cookieParamsOptions.Value;
|
||||
_userSignatureHandler = userSignatureHandler;
|
||||
_cryptoFactory = cryptoFactory;
|
||||
_keyPool = keyPool;
|
||||
_logger = logger;
|
||||
_userService = userService;
|
||||
_dirSearchService = dirSearchService;
|
||||
@@ -82,7 +84,7 @@ namespace DigitalData.Auth.API.Controllers
|
||||
if (consumer is null)
|
||||
return Unauthorized();
|
||||
|
||||
if (!_cryptoFactory.TokenDescriptors.TryGet(_apiParams.Issuer, consumer.Audience, out var descriptor))
|
||||
if (!_keyPool.TokenDescriptors.TryGet(_apiParams.Issuer, consumer.Audience, out var descriptor))
|
||||
return StatusCode(StatusCodes.Status500InternalServerError);
|
||||
|
||||
var token = _userSignatureHandler.WriteToken(uRes!.Data, descriptor);
|
||||
@@ -104,7 +106,7 @@ namespace DigitalData.Auth.API.Controllers
|
||||
if (consumer is null || consumer.Password != login.Password)
|
||||
return Unauthorized();
|
||||
|
||||
if (!_cryptoFactory.TokenDescriptors.TryGet(_apiParams.Issuer, _apiParams.LocalConsumer.Audience, out var descriptor))
|
||||
if (!_keyPool.TokenDescriptors.TryGet(_apiParams.Issuer, _apiParams.LocalConsumer.Audience, out var descriptor))
|
||||
return StatusCode(StatusCodes.Status500InternalServerError);
|
||||
|
||||
var token = _consumerSignatureHandler.WriteToken(consumer, descriptor);
|
||||
|
||||
Reference in New Issue
Block a user