Files
SecureBank/SecureBank.API/SecureBank.API.Authentication/AuthenticationConfiguration.cs

37 lines
1.1 KiB
C#
Raw Normal View History

2024-01-19 17:25:56 +01:00
using Microsoft.Extensions.Configuration;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SecureBank.API.Authentication
{
public class AuthenticationConfiguration
{
#region PROPERTIES
// Token
public string TokenKey { get; private set; }
public string TokenIssuer { get; private set; }
public string TokenAudience { get; private set; }
public int TokenLifetime { get; private set; }
#endregion
#region CONSTRUCTORS
public AuthenticationConfiguration(IConfiguration configuration)
{
TokenKey = configuration.GetSection("Authentication").GetSection("Token")["Key"];
TokenIssuer = configuration.GetSection("Authentication").GetSection("Token")["Issuer"];
TokenAudience = configuration.GetSection("Authentication").GetSection("Token")["Audience"];
TokenLifetime = int.Parse(configuration.GetSection("Authentication").GetSection("Token")["Lifetime"]);
}
#endregion
}
}