Skip to content

Conversation

@fadidurah
Copy link
Contributor

@fadidurah fadidurah commented Nov 19, 2025

We no longer need to pass the functions keys when calling lab api, just having the certificate token in headers is enough when making the request. All Lab APIs are now working again, needed to update their http request methods as well, all should use POST.

https://identitydivision.visualstudio.com/Engineering/_build/results?buildId=1560386&view=results

https://identitydivision.visualstudio.com/Engineering/_build/results?buildId=1560092&view=results

AB#3430779, 3429582

@fadidurah fadidurah requested a review from a team as a code owner November 19, 2025 00:18
Copilot AI review requested due to automatic review settings November 19, 2025 00:18
@github-actions
Copy link

❌ Work item link check failed. Description does not contain AB#{ID}.

Click here to Learn more.

Copilot finished reviewing on behalf of fadidurah November 19, 2025 00:21
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR removes the need to pass Azure Function keys when calling Lab APIs, switching to certificate token-based authentication in headers. Additionally, it updates HTTP request methods from PUT/DELETE to POST for several Lab API endpoints and improves error messages in test utilities.

  • Removed function key retrieval logic and associated parameters from all Lab API classes
  • Changed HTTP methods from PUT/DELETE to POST for ResetApi, EnablePolicyApi, DisablePolicyApi, and DeleteDeviceApi
  • Updated error messages to be more descriptive and include context (e.g., package names)
  • Cleaned up unused imports and exception handling related to LabApiException
  • Re-enabled previously ignored tests that now work with the updated authentication

Reviewed Changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.

Show a summary per file
File Description
uiautomationutilities/src/main/java/com/microsoft/identity/client/ui/automation/utils/AdbShellUtils.java Enhanced error message to include package name when installation fails
testutils/src/main/java/com/microsoft/identity/internal/testutils/labutils/PolicyHelper.java Removed function key retrieval, simplified API construction, removed unused imports and LabApiException handling
testutils/src/main/java/com/microsoft/identity/internal/testutils/labutils/LabUserHelper.java Removed function key retrieval logic and simplified API initialization for temp user creation and password reset
testutils/src/main/java/com/microsoft/identity/internal/testutils/labutils/LabResetHelper.java Removed function key retrieval, simplified API construction, and removed LabApiException catch blocks
testutils/src/main/java/com/microsoft/identity/internal/testutils/labutils/LabDeviceHelper.java Removed function key retrieval and simplified DeleteDeviceApi construction
labapi/src/main/java/com/microsoft/identity/internal/test/labapi/api/ResetApi.java Removed Azure function code parameters, changed HTTP method from PUT to POST, cleaned up imports
labapi/src/main/java/com/microsoft/identity/internal/test/labapi/api/EnablePolicyApi.java Removed Azure function code parameters and query string code appending, changed HTTP method from PUT to POST
labapi/src/main/java/com/microsoft/identity/internal/test/labapi/api/DisablePolicyApi.java Removed Azure function code parameters and query string code appending, changed HTTP method from PUT to POST
labapi/src/main/java/com/microsoft/identity/internal/test/labapi/api/DeleteDeviceApi.java Removed Azure function code parameters, changed HTTP method from DELETE to POST, cleaned up imports
labapi/src/main/java/com/microsoft/identity/internal/test/labapi/api/CreateTempUserApi.java Removed Azure function code parameters and query string code appending, simplified constructor
LabApiUtilities/src/test/com/microsoft/identity/labapi/utilities/client/LabClientTest.java Re-enabled previously ignored tests for password reset, policy enable, and policy disable
LabApiUtilities/src/main/com/microsoft/identity/labapi/utilities/constants/LabConstants.java Changed ResetOperation constants from capitalized to lowercase ("MFA"→"mfa", "Password"→"password")
LabApiUtilities/src/main/com/microsoft/identity/labapi/utilities/client/LabClient.java Removed function key retrieval throughout, simplified API construction, added access token setup for reset/policy operations

@github-actions
Copy link

✅ Work item link check complete. Description contains link AB#3430779 to an Azure Boards work item.

@fadidurah fadidurah added the No-Changelog This Pull-Request has no associated changelog entry. label Nov 19, 2025
@github-actions github-actions bot changed the title revert function key append, update HTTP request methods revert function key append, update HTTP request methods, Fixes AB#3430779 Nov 19, 2025
@github-actions
Copy link

✅ Work item link check complete. Description contains link AB#3430779 to an Azure Boards work item.

final DeleteDeviceApi deleteDeviceApi = new DeleteDeviceApi();

try {
final CustomSuccessResponse successResponse = deleteDeviceApi.apiDeleteDeviceDelete(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity, when is CustomSuccessResponse expected as a result vs a general string?

Copy link
Contributor Author

@fadidurah fadidurah Nov 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These Response classes are generated code, from a few years ago, they map to a particular json schema that lab was sending at one point. In the case of delete Device, that schema is no longer there due to bypassing the msidlabs layer, it's just sending us a string. This can should probably be changed on lab's side, but i don't really think such a change is worth it as it may cause another outage.

@fadidurah fadidurah merged commit 8bdb7ba into dev Nov 21, 2025
24 of 25 checks passed
fadidurah added a commit to AzureAD/microsoft-authentication-library-for-android that referenced this pull request Nov 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

No-Changelog This Pull-Request has no associated changelog entry.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants