|
|
@ -1,13 +1,12 @@
|
|
|
|
using System.IdentityModel.Tokens.Jwt;
|
|
|
|
using System.IdentityModel.Tokens.Jwt;
|
|
|
|
using System.Security.Claims;
|
|
|
|
using System.Security.Claims;
|
|
|
|
using Microsoft.AspNetCore.Cryptography.KeyDerivation;
|
|
|
|
|
|
|
|
using Microsoft.IdentityModel.Tokens;
|
|
|
|
using Microsoft.IdentityModel.Tokens;
|
|
|
|
|
|
|
|
|
|
|
|
namespace API.Auth;
|
|
|
|
namespace API.Auth;
|
|
|
|
|
|
|
|
|
|
|
|
public static class Authentication
|
|
|
|
public static class Authentication
|
|
|
|
{
|
|
|
|
{
|
|
|
|
private static readonly TimeSpan TokenLifetime = TimeSpan.FromMinutes(50);
|
|
|
|
private static readonly TimeSpan TokenLifetime = TimeSpan.FromMinutes(15);
|
|
|
|
|
|
|
|
|
|
|
|
public static (string, DateTime) GenerateJwt(SymmetricSecurityKey key, IEnumerable<Claim> claims)
|
|
|
|
public static (string, DateTime) GenerateJwt(SymmetricSecurityKey key, IEnumerable<Claim> claims)
|
|
|
|
{
|
|
|
|
{
|
|
|
|