Skip to content

Commit

Permalink
PRIME-2737 Log roles as well (#2526)
Browse files Browse the repository at this point in the history
* Test logging

* Roles logged

---------

Co-authored-by: Jack Wong <[email protected]>
  • Loading branch information
neophyte57 and bergomi02 authored Jun 17, 2024
1 parent dd20f4f commit c4b46c6
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,9 @@ private static Task OnTokenValidatedAsync(TokenValidatedContext context)
if (context.Request.Path.ToString().Contains("gpid-detail"))
{
JwtPayload payload = ((JwtSecurityToken)context.SecurityToken).Payload;
Log.Logger.Debug($"Token for gpid-detail: Issuer: {payload.Iss}, Authorized Party: {payload.Azp}, Audiences: [{string.Join(",", payload.Aud.ToArray())}], Expires at: {payload.Expiration}");
Log.Logger.Debug($"Token for gpid-detail: Issuer: {payload.Iss}, Authorized Party: {payload.Azp}, Audiences: [{string.Join(",", payload.Aud.ToArray())}], Expires at: {payload.Expiration}, resource_access: {identity.Claims.SingleOrDefault(claim => claim.Type == Claims.ResourceAccess)?.Value}");
}
}

return Task.CompletedTask;
}

Expand Down

0 comments on commit c4b46c6

Please sign in to comment.