DigitalData.Core/DigitalData.Core.Security/TokenDescriptorProvider.cs

19 lines
489 B
C#

using AutoMapper;
using DigitalData.Core.Security.Config;
using Microsoft.IdentityModel.Tokens;
namespace DigitalData.Core.Security
{
public class TokenDescriptorProvider
{
private readonly IMapper _mapper;
public TokenDescriptorProvider(IMapper mapper)
{
_mapper = mapper;
}
public SecurityTokenDescriptor Create(TokenDescription description)
=> _mapper.Map(description, new SecurityTokenDescriptor());
}
}