Skip to content

Conversation

@fadidurah
Copy link
Contributor

@fadidurah fadidurah commented Dec 2, 2025

Only need one auth client. Having a second one referencing BuildConfigs will cause issues if the build configs are not passed at library build time.

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

AB#3447250

@fadidurah fadidurah requested a review from a team as a code owner December 2, 2025 02:50
Copilot AI review requested due to automatic review settings December 2, 2025 02:50
@fadidurah fadidurah added the No-Changelog This Pull-Request has no associated changelog entry. label Dec 2, 2025
@github-actions
Copy link

github-actions bot commented Dec 2, 2025

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

Click here to Learn more.

@github-actions
Copy link

github-actions bot commented Dec 2, 2025

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

@github-actions github-actions bot changed the title lab tweak, one auth client lab tweak, one auth client, Fixes AB#3447250 Dec 2, 2025
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 consolidates authentication client usage in the Lab API utilities to avoid BuildConfig dependencies at library build time. The change removes a dedicated KeyVault authentication client and extends the existing authentication client to support custom scopes dynamically.

  • Removed the separate mLabApiAuthenticationClientForKeyVault field that required BuildConfig at construction time
  • Added getAccessTokenForCustomScope() method to dynamically request tokens with custom scopes
  • Updated getKeyVaultSecret() to use the single authentication client with a custom scope parameter

Reviewed changes

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

File Description
LabApiUtilities/src/main/com/microsoft/identity/labapi/utilities/client/LabClient.java Removed dedicated KeyVault auth client field and updated getKeyVaultSecret to use main auth client with custom scope
LabApiUtilities/src/main/com/microsoft/identity/labapi/utilities/authentication/LabApiAuthenticationClient.java Added getAccessTokenForCustomScope method and refactored internal token acquisition to support dynamic scope parameter

@mohitc1
Copy link
Contributor

mohitc1 commented Dec 2, 2025

private final String mScope;

let's get of rid of this and corresponding constructor. there's only one other caller of the constructor, which can use your new method.

This will clean up the class and your change.


Refers to: LabApiUtilities/src/main/com/microsoft/identity/labapi/utilities/authentication/LabApiAuthenticationClient.java:54 in 7e297b6. [](commit_id = 7e297b6, deletion_comment = False)

@fadidurah
Copy link
Contributor Author

private final String mScope;

let's get of rid of this and corresponding constructor. there's only one other caller of the constructor, which can use your new method.

This will clean up the class and your change.

Refers to: LabApiUtilities/src/main/com/microsoft/identity/labapi/utilities/authentication/LabApiAuthenticationClient.java:54 in 7e297b6. [](commit_id = 7e297b6, deletion_comment = False)

I think we can remove mScope (and ability to pass it through constructor), and just have a default scope field for anyone using getAccessToken().

Copy link
Contributor

@mohitc1 mohitc1 left a comment

Choose a reason for hiding this comment

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

🕐

Copy link
Contributor

@mohitc1 mohitc1 left a comment

Choose a reason for hiding this comment

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

:shipit:

@fadidurah fadidurah merged commit ea12611 into dev Dec 2, 2025
43 of 45 checks passed
@fadidurah fadidurah deleted the fadi/lab-tweak branch December 15, 2025 01:10
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