JwtToken 1.0

This commit is contained in:
2025-03-12 09:48:57 +01:00
parent da27f7e882
commit 29e6efc9e0
15 changed files with 867 additions and 35 deletions
@@ -10,16 +10,16 @@ namespace WorkFlowCheck.Web.Middleware
{
public class JwtService
{
private const string SecretKey = "super_secret_key";
public readonly IConfiguration _configuration;
private readonly HttpClient _httpClient;
public JwtService(HttpClient httpClient,IConfiguration configuration)
public JwtService(HttpClient httpClient, IConfiguration configuration)
{
_configuration = configuration;
_httpClient = httpClient;
}
_httpClient = httpClient;
}
public async Task<string?> AuthenticateUserAsync(UserDTO userDTO)
{
@@ -32,7 +32,7 @@ namespace WorkFlowCheck.Web.Middleware
var response = await Authenticate(userDTO.UserName, userDTO.Password);
if (response != null && response.IsSuccess)
{
var claims = new[]
{
new Claim(ClaimTypes.Name, userDTO.UserName),
@@ -67,6 +67,7 @@ namespace WorkFlowCheck.Web.Middleware
Id = 0,
UserName = username,
Password = password,
RoleDTO = new List<RoleDTO>()
};
// HTTP POST kérés küldése
+2 -2
View File
@@ -2,9 +2,9 @@
"ApiBaseUrl": "https://wfcapi.nuvolar.hu/",
"ApiKey": "RUJeLSpSMzVASUdaRCEzUyYxRSE0VyFISFRSJC0zRzhLM1hCSDU=",
"Jwt": {
"SecretKey": "super_secret_key",
"SecretKey": "9aLxV2t7RpM8BfKqZwXy3GehYJDUNTCrHkVZ",
"Issuer": "https://wfcapi.nuvolar.hu/",
"Audience": "https://mywebapp.com",
"Audience": "wfc-application",
"TokenLifetimeMinutes": 30
},
"Logging": {