Skip to content

Commit

Permalink
Roles logged
Browse files Browse the repository at this point in the history
  • Loading branch information
neophyte57 committed Jun 12, 2024
1 parent 7109ca0 commit 48c0731
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions prime-dotnet-webapi/Configuration/Auth/AuthenticationSetup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ private static Task OnTokenValidatedAsync(TokenValidatedContext context)

FlattenRealmAccessRoles(identity);

// 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}, resource_access: {identity.Claims.SingleOrDefault(claim => claim.Type == Claims.ResourceAccess)?.Value}");
// }
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}, resource_access: {identity.Claims.SingleOrDefault(claim => claim.Type == Claims.ResourceAccess)?.Value}");
}
}
return Task.CompletedTask;
}
Expand Down

0 comments on commit 48c0731

Please sign in to comment.