Skip to content

Commit

Permalink
Add Support authorization
Browse files Browse the repository at this point in the history
  • Loading branch information
Ali-YousefiTelori committed Nov 27, 2023
1 parent 6665937 commit 8014fea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="EasyMicroservices.Cores.AspEntityFrameworkCoreApi" Version="0.0.0.53" />
<PackageReference Include="EasyMicroservices.Cores.AspEntityFrameworkCoreApi" Version="0.0.0.57" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace EasyMicroservices.IdentityMicroservice.Helpers
public class IdentityHelper
{
private readonly IConfiguration _config;
private readonly UsersClient _userClient;
private readonly UserClient _userClient;
private readonly IJWTManager _jwtManager;
private readonly string _authRoot;

Expand Down Expand Up @@ -58,15 +58,9 @@ public virtual async Task<MessageContract<LoginResponseContract>> Login(Contract
};
}

public virtual async Task<MessageContract<UserResponseContract>> GenerateToken(UserClaimContract cred)
public virtual async Task<MessageContract<UserResponseContract>> GenerateToken(UserClaimContract userClaim)
{
var response = await Login(cred);
if (!response)
return response.ToContract<UserResponseContract>();

var user = await _userClient.VerifyUserIdentityAsync(new Authentications.GeneratedServices.UserSummaryContract { UserName = cred.UserName, Password = cred.Password });

var token = await _jwtManager.GenerateTokenWithClaims(cred.Claims);
var token = await _jwtManager.GenerateTokenWithClaims(userClaim.Claims);

return new UserResponseContract
{
Expand Down

0 comments on commit 8014fea

Please sign in to comment.