663. Full 3-leg flow: FMI → assertion → user_fic → user-scoped token
774. Cache isolation between app-only and user-scoped tokens
88
9- Corresponds to:
10- - .NET: Agentic.cs
11- - Java: AgenticIT.java
12-
139Test configuration uses the same lab infrastructure as test_fmi_e2e.py.
1410Requires LAB_APP_CLIENT_CERT_PFX_PATH environment variable.
1511"""
2824logging .basicConfig (level = logging .DEBUG if "-v" in sys .argv else logging .INFO )
2925
3026# =============================================================================
31- # Test configuration — matches .NET/Java agentic test constants
27+ # Test configuration — shared lab app registrations for agentic scenarios
3228# =============================================================================
3329_TENANT_ID = "10c419d4-4a50-45b2-aa4e-919fb84df24f"
3430_BLUEPRINT_CLIENT_ID = "aab5089d-e764-47e3-9f28-cc11c2513821"
4339
4440
4541# =============================================================================
46- # Helpers — mirror .NET GetAppCredentialAsync / Java acquireFmiCredentialForAgent
42+ # Helpers
4743# =============================================================================
4844
4945def _acquire_fmi_credential_for_agent (agent_app_id ):
5046 """Leg 1: Blueprint app acquires FMI credential (T1) for the given agent.
5147
5248 Uses certificate authentication with SNI (sendX5C) and fmi_path set to
53- the agent app ID — matching .NET and Java helper methods .
49+ the agent app ID.
5450 """
5551 blueprint_app = msal .ConfidentialClientApplication (
5652 _BLUEPRINT_CLIENT_ID ,
@@ -70,7 +66,7 @@ def _acquire_fmi_credential_for_agent(agent_app_id):
7066def _acquire_fmi_credential_from_rma ():
7167 """Acquire an FMI credential from the RMA app using certificate credentials.
7268
73- Mirrors Java's acquireFmiCredentialFromRma and Python's test_fmi_e2e helper .
69+ Uses the same RMA pattern as test_fmi_e2e._get_fmi_credential_from_rma() .
7470 Used for assertion callback context tests where the callback just needs to
7571 return a valid FMI token (not specifically for an agent app).
7672 """
@@ -118,10 +114,7 @@ def _acquire_instance_token_for_agent():
118114# =============================================================================
119115
120116class TestAssertionCallbackContext (LabBasedTestCase ):
121- """Verify assertion callback receives correct context when fmi_path is set.
122-
123- Corresponds to Java's assertionCallback_ReceivesFmiPathContext.
124- """
117+ """Verify assertion callback receives correct context when fmi_path is set."""
125118
126119 def test_assertion_callback_receives_fmi_path (self ):
127120 captured_context = {}
@@ -155,9 +148,6 @@ def assertion_callback(context):
155148class TestAgentAppToken (LabBasedTestCase ):
156149 """Agent acquires app-only token for Graph using FMI-sourced assertion.
157150
158- Corresponds to .NET's AgentGetsAppTokenForGraphTest and
159- Java's agentGetsAppToken_UsingFmiAssertion.
160-
161151 Flow: Blueprint → T1 (assertion callback) → Agent CCA → app token
162152 """
163153
@@ -183,9 +173,6 @@ def assertion_provider(context):
183173class TestAgentUserIdentity (LabBasedTestCase ):
184174 """Full 3-leg agent identity flow: FMI → assertion → user_fic → user token.
185175
186- Corresponds to .NET's AgentUserIdentityGetsTokenForGraphTest and
187- Java's agentUserIdentity_GetsTokenForGraph.
188-
189176 Flow:
190177 1. Blueprint → T1 (FMI credential)
191178 2. Agent uses T1 → T2 (instance token)
@@ -234,10 +221,7 @@ def assertion_provider(context):
234221
235222
236223class TestAgentCacheIsolation (LabBasedTestCase ):
237- """App-only and user-scoped tokens are isolated in cache on the same CCA.
238-
239- Corresponds to Java's agentCca_AppAndUserTokens_CacheIsolation.
240- """
224+ """App-only and user-scoped tokens are isolated in cache on the same CCA."""
241225
242226 def test_app_and_user_tokens_are_isolated (self ):
243227 def assertion_provider (context ):
0 commit comments