Add role-extraction diagnostic log to OnTicketReceived

Logs extracted Keycloak roles at login time to diagnose access-denied failures.

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
This commit is contained in:
dingo
2026-04-04 13:16:52 -04:00
co-authored by Claude Happy
parent 33b544a404
commit f9ec834a7a
+6
View File
@@ -100,6 +100,12 @@ builder.Services
var accessToken = ctx.Properties?.GetTokenValue("access_token");
if (string.IsNullOrEmpty(accessToken)) return Task.CompletedTask;
AddKeycloakRoleClaims(identity, accessToken);
var roles = identity.Claims
.Where(c => c.Type == ClaimTypes.Role)
.Select(c => c.Value);
ctx.HttpContext.RequestServices
.GetRequiredService<ILogger<Program>>()
.LogInformation("Keycloak roles extracted: [{Roles}]", string.Join(", ", roles));
return Task.CompletedTask;
},
};