JwtToken 1.0
This commit is contained in:
@@ -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,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": {
|
||||
|
||||
Reference in New Issue
Block a user