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
|
||||
|
||||
Reference in New Issue
Block a user