Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
44a045b
Fix #3840: Use native MSAL UserFIC API for agentic UPN flows
Avery-Dunn Jun 4, 2026
a267646
Add OID UserFIC support, bump MSAL to 4.84.2, remove add-in
Avery-Dunn Jun 5, 2026
9821f57
Better handling of national cloud endpoints for FIC scope
Avery-Dunn Jun 5, 2026
5952470
Fix #3840: Use native MSAL UserFIC API for agentic UPN flows
Avery-Dunn Jun 4, 2026
aa4b404
Add OID UserFIC support, bump MSAL to 4.84.2, remove add-in
Avery-Dunn Jun 5, 2026
e4b3f16
Better handling of national cloud endpoints for FIC scope
Avery-Dunn Jun 5, 2026
e3f4ee1
Merge branch 'avdunn/agentic-fic-scenario-fix' of https://github.com/…
Avery-Dunn Jun 5, 2026
8127263
Add agent CCA instance eviction strategy
Avery-Dunn Jun 16, 2026
3cb9ae8
PR feedback
Avery-Dunn Jun 16, 2026
c3d8ef3
Merge branch 'master' into avdunn/agentic-fic-scenario-fix
Avery-Dunn Jun 16, 2026
dd7a1f2
Fix test issue
Avery-Dunn Jun 16, 2026
b063974
Merge branch 'avdunn/agentic-fic-scenario-fix' of https://github.com/…
Avery-Dunn Jun 16, 2026
ffef916
More logging and less overrides
Avery-Dunn Jun 17, 2026
c0532be
Merge branch 'master' into avdunn/agentic-fic-scenario-fix
Avery-Dunn Jun 26, 2026
dc7585a
Remove upn/oid from agentic flow logs
Avery-Dunn Jun 26, 2026
da1b63d
Enable shared static cache for agent CCAs and add cache isolation tests
Avery-Dunn Jun 26, 2026
14a4849
Clean up tests and comments: consolidate redundant tests, fix stale c…
Avery-Dunn Jun 26, 2026
19dcddc
Replace periodic sweep with simple size-threshold eviction
Avery-Dunn Jun 26, 2026
e694d1e
Merge remote-tracking branch 'origin/master' into avdunn/agentic-fic-…
Avery-Dunn Jun 29, 2026
e813abd
Address review feedback: normalize agentAppId, handle Guid OID values…
Avery-Dunn Jun 30, 2026
ae8a04a
Fix CS8602 on older TFMs and drop unnecessary agentAppId normalization
Avery-Dunn Jun 30, 2026
956f849
Address review feedback: simplify OID detection, use MSAL TenantId, r…
Avery-Dunn Jul 7, 2026
4473dc4
Tighten catch
Avery-Dunn Jul 7, 2026
1c3956d
Remove unneeded shared cache toggle
Avery-Dunn Jul 7, 2026
bcbfea8
Refactor CCA instance management in agentic flows (#3930)
Avery-Dunn Jul 8, 2026
4520e10
Merge branch 'master' into avdunn/agentic-fic-scenario-fix
Avery-Dunn Jul 8, 2026
1d174c9
Merge branch 'master' into avdunn/agentic-fic-scenario-fix
Avery-Dunn Jul 9, 2026
82628cd
Merge branch 'master' into avdunn/agentic-fic-scenario-fix
Avery-Dunn Jul 13, 2026
a3c52a7
Merge branch 'master' into avdunn/agentic-fic-scenario-fix
Avery-Dunn Jul 13, 2026
b7cad39
Merge branch 'master' into avdunn/agentic-fic-scenario-fix
Avery-Dunn Jul 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using System.Collections.Generic;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Identity.Abstractions;
using Microsoft.Identity.Web.AgentIdentities;

namespace Microsoft.Identity.Web
{
Expand All @@ -26,12 +25,6 @@ public static IServiceCollection AddAgentIdentities(this IServiceCollection serv
// Register the OidcFic services for agent applications to work.
services.AddOidcFic();

// Register a callback to process the agent user identity before acquiring a token.
services.Configure<TokenAcquisitionExtensionOptions>(options =>
{
options.OnBeforeTokenAcquisitionForTestUserAsync += AgentUserIdentityMsalAddIn.OnBeforeUserFicForAgentUserIdentityAsync;
});

return services;
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ internal static class LoggingEventId
public static readonly EventId AuthorityIgnored = new EventId(500, "AuthorityIgnored");
public static readonly EventId AuthorityUsedConsiderInstanceTenantId = new EventId(501, "AuthorityUsedConsiderInstanceTenantId");

// Agent User FIC EventIds 600+
public static readonly EventId AgentUserFicFlowDetected = new EventId(600, "AgentUserFicFlowDetected");
public static readonly EventId AgentUserFicSilentSuccess = new EventId(601, "AgentUserFicSilentSuccess");
public static readonly EventId AgentUserFicSilentFailure = new EventId(602, "AgentUserFicSilentFailure");
public static readonly EventId AgentUserFicAcquisitionComplete = new EventId(603, "AgentUserFicAcquisitionComplete");
public static readonly EventId AgentCcaCreated = new EventId(604, "AgentCcaCreated");
public static readonly EventId AgentCcaEviction = new EventId(605, "AgentCcaEviction");

#pragma warning restore IDE1006 // Naming Styles
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,62 @@ public static void TokenAcquisitionMsalAuthenticationResultTime(
cacheRefreshReason,
ex);
}

// --- Agent User FIC logging ---

private static readonly Action<ILogger, string, string, Exception?> s_agentUserFicFlowDetected =
LoggerMessage.Define<string, string>(
LogLevel.Information,
LoggingEventId.AgentUserFicFlowDetected,
"[MsIdWeb] Agent User FIC flow detected for agent '{AgentAppId}' with user identifier type '{IdentifierType}'.");

private static readonly Action<ILogger, string, string, Exception?> s_agentUserFicSilentSuccess =
LoggerMessage.Define<string, string>(
LogLevel.Debug,
LoggingEventId.AgentUserFicSilentSuccess,
"[MsIdWeb] Agent User FIC silent token acquisition succeeded for agent '{AgentAppId}' in tenant '{TenantId}'.");

private static readonly Action<ILogger, string, string, string, Exception?> s_agentUserFicSilentFailure =
LoggerMessage.Define<string, string, string>(
LogLevel.Information,
LoggingEventId.AgentUserFicSilentFailure,
"[MsIdWeb] Agent User FIC silent token acquisition failed for agent '{AgentAppId}' in tenant '{TenantId}': {Reason}. Falling back to 3-leg acquisition.");

private static readonly Action<ILogger, string, string, Exception?> s_agentUserFicAcquisitionComplete =
LoggerMessage.Define<string, string>(
LogLevel.Information,
LoggingEventId.AgentUserFicAcquisitionComplete,
"[MsIdWeb] Agent User FIC 3-leg acquisition complete for agent '{AgentAppId}', token source: {TokenSource}.");

private static readonly Action<ILogger, string, Exception?> s_agentCcaCreated =
LoggerMessage.Define<string>(
LogLevel.Information,
LoggingEventId.AgentCcaCreated,
"[MsIdWeb] Created new agent CCA for cache key '{CcaCacheKey}'.");

private static readonly Action<ILogger, int, Exception?> s_agentCcaEviction =
LoggerMessage.Define<int>(
LogLevel.Information,
LoggingEventId.AgentCcaEviction,
"[MsIdWeb] CCA dictionary cleared ({EvictedCount} entries exceeded size threshold).");

public static void AgentUserFicFlowDetected(ILogger logger, string agentAppId, string identifierType)
=> s_agentUserFicFlowDetected(logger, agentAppId, identifierType, null);

public static void AgentUserFicSilentSuccess(ILogger logger, string agentAppId, string tenantId)
=> s_agentUserFicSilentSuccess(logger, agentAppId, tenantId, null);

public static void AgentUserFicSilentFailure(ILogger logger, string agentAppId, string tenantId, string reason, Exception? ex)
=> s_agentUserFicSilentFailure(logger, agentAppId, tenantId, reason, ex);

public static void AgentUserFicAcquisitionComplete(ILogger logger, string agentAppId, string tokenSource)
=> s_agentUserFicAcquisitionComplete(logger, agentAppId, tokenSource, null);

public static void AgentCcaCreated(ILogger logger, string ccaCacheKey)
=> s_agentCcaCreated(logger, ccaCacheKey, null);

public static void AgentCcaEviction(ILogger logger, int evictedCount)
=> s_agentCcaEviction(logger, evictedCount, null);
}
}
}
Loading
Loading