mirror of
https://github.com/okieselbach/AutopilotMonitor.git
synced 2026-10-24 12:42:38 +00:00
added logging for debug
This commit is contained in:
@@ -1 +1 @@
|
||||
687
|
||||
688
|
||||
|
||||
@@ -236,11 +236,18 @@ public class AuthenticationMiddleware : IFunctionsWorkerMiddleware
|
||||
var oid = principal.GetObjectId();
|
||||
var upn = principal.GetUserPrincipalName();
|
||||
var tid = principal.GetTenantId();
|
||||
_logger.LogWarning("[Auth Middleware] Usage tracking: oid={Oid}, upn={Upn}, tid={Tid}, path={Path}",
|
||||
oid ?? "(null)", upn ?? "(null)", tid ?? "(null)", requestPath);
|
||||
if (!string.IsNullOrEmpty(oid))
|
||||
{
|
||||
var normalizedEndpoint = EndpointNormalizer.Normalize(requestPath);
|
||||
_ = Task.Run(() => RecordUserUsageAsync(oid, upn ?? "unknown", tid ?? "", normalizedEndpoint));
|
||||
}
|
||||
else
|
||||
{
|
||||
_logger.LogWarning("[Auth Middleware] No oid claim found — usage NOT tracked. Claims: {Claims}",
|
||||
string.Join(", ", principal.Claims.Select(c => $"{c.Type}={c.Value}")));
|
||||
}
|
||||
}
|
||||
catch (SecurityTokenValidationException ex)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user