Commit 1e082d3
authored
Fix ADFS tests for id4slab1 lab migration. (#5810)
* Re-enable ADFS tests for id4slab1 migration
- Comment out MSAL_SKIP_FEDERATED_TESTS prop in Directory.Build.props so ADFS tests always run regardless of pipeline variable group
- Update ADFSAuthority constant to point to fs.id4slab1.com (new lab)
- Remove unused Adfs2019LabConstants class (no references in codebase)
* Fix PopWhithAdfsUserAndBroker_Async cache environment after ADFS authority migration
* Fix ADFS interactive Selenium test failures
- UserInformationFieldIds.DetermineFieldIds: use OrdinalIgnoreCase for
UserType comparisons. KeyVault stores 'federated' (lowercase) but
LabConstants.UserTypeFederated is 'Federated', causing the case-sensitive
== to fall through to AAD field IDs on an ADFS page (root cause).
- InteractiveFlowTests.RunTestForUserAsync: use FindFreeLocalhostRedirectUri()
for the non-direct path to avoid HttpListenerException port conflict with
Interactive_Adfs_DirectAsync on localhost:52073. AAD public client apps
accept any http://localhost:{port} so a dynamic port is valid here.
* Fix all ADFS test failures for id4slab1 lab migration
ClientCredentialsTests.NetFwk.cs:
- Fix audience check: Contains('/adfs/') fails for authority without trailing
slash. Changed to Contains('/adfs'). Bug introduced in a51b7f6 (Avery-Dunn,
Jan 15 2026), never caught because IGNORE_FEDERATED was still gating tests.
Also required server-side fixes on ADDC1 (cert in Root store + JWTSigningKey).
UsernamePasswordIntegrationTests.NetFwk.cs:
- Use AppAdfsNativeClient (ADFS NativeClientApplication GUID) instead of
AppPCAClient (ServerApplication GUID). ADFS ServerApplications require client
auth; public client ROPC flows need a NativeClientApplication registration.
InteractiveFlowTests.NetFwk.cs:
- Same AppAdfsNativeClient fix for Interactive_Adfs_DirectAsync.
KeyVaultSecrets.cs:
- Add AppAdfsNativeClient = 'App-AdfsNativeClient-Config' constant pointing to
NativeClientApplication (c697bd8e-16d8-4f73-97d8-262e446581c2) registered
in MSAL-Lab-Tests group on ADDC1.
SeleniumExtensions.cs / UserInformationFieldIds.cs:
- Simplify EnterPassword: remove redundant ADFS fallback logic (now handled
upstream by DetermineFieldIds with OrdinalIgnoreCase comparison).
Server-side changes on ADDC1 (permanent, not code):
- NativeClientApplication 'MSAL-Lab-Client-Native' registered in MSAL-Lab-Tests
- KV secret 'App-AdfsNativeClient-Config' created in id4skeyvault
All 11 ADFS tests now pass locally (8 on NetCore, 3 on NetFx).
* Restore tests/Directory.Build.props to match main (MSAL_SKIP_FEDERATED_TESTS == True)
* Fix ADFS authority detection: use Uri path segment comparison instead of string.Contains1 parent 96dc781 commit 1e082d3
8 files changed
Lines changed: 1691 additions & 1685 deletions
File tree
- src/client/Microsoft.Identity.Lab.Api
- Internal
- LabInfra
- tests
- Microsoft.Identity.Test.Integration.netcore
- HeadlessTests
- Infrastructure
- SeleniumTests
- Microsoft.Identity.Test.Unit/pop
Lines changed: 1667 additions & 1667 deletions
Large diffs are not rendered by default.
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
56 | 61 | | |
57 | 62 | | |
58 | 63 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
53 | | - | |
| 54 | + | |
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
| |||
Lines changed: 9 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
555 | 555 | | |
556 | 556 | | |
557 | 557 | | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
558 | 565 | | |
559 | 566 | | |
560 | 567 | | |
| |||
564 | 571 | | |
565 | 572 | | |
566 | 573 | | |
567 | | - | |
568 | | - | |
569 | | - | |
570 | | - | |
571 | | - | |
572 | 574 | | |
573 | 575 | | |
574 | | - | |
| 576 | + | |
575 | 577 | | |
576 | 578 | | |
577 | 579 | | |
578 | 580 | | |
579 | 581 | | |
580 | | - | |
581 | | - | |
582 | | - | |
583 | | - | |
584 | 582 | | |
585 | 583 | | |
586 | 584 | | |
587 | | - | |
| 585 | + | |
588 | 586 | | |
589 | 587 | | |
590 | 588 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
| 83 | + | |
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
| 74 | + | |
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| |||
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
141 | | - | |
| 141 | + | |
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| |||
216 | 216 | | |
217 | 217 | | |
218 | 218 | | |
| 219 | + | |
| 220 | + | |
219 | 221 | | |
220 | 222 | | |
221 | | - | |
| 223 | + | |
222 | 224 | | |
223 | 225 | | |
224 | 226 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
274 | 274 | | |
275 | 275 | | |
276 | 276 | | |
277 | | - | |
| 277 | + | |
278 | 278 | | |
279 | 279 | | |
280 | 280 | | |
| |||
0 commit comments