Files
SIG-CM2.0/src/api/SIGCM2.Infrastructure/Security/RefreshTokenGenerator.cs

18 lines
495 B
C#
Raw Normal View History

using System.Security.Cryptography;
using SIGCM2.Application.Abstractions.Security;
namespace SIGCM2.Infrastructure.Security;
public sealed class RefreshTokenGenerator : IRefreshTokenGenerator
{
public string Generate()
{
Span<byte> bytes = stackalloc byte[32];
RandomNumberGenerator.Fill(bytes);
return Convert.ToBase64String(bytes)
.TrimEnd('=')
.Replace('+', '-')
.Replace('/', '_');
}
}