Add APIs to add client capabilities and claims#929
Merged
neha-bhargava merged 6 commits intodevfrom Apr 9, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds APIs to support client capabilities and claims for the managed identity application, along with test coverage to verify token acquisition with claims.
- Introduces a new test case in ManagedIdentityTests.java to validate acquiring a token with claims.
- Updates ManagedIdentityParameters.java to include a claims field and modify the claims() method.
- Enhances ManagedIdentityApplication.java with a new builder method to set client capabilities.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| msal4j-sdk/src/test/java/com/microsoft/aad/msal4j/ManagedIdentityTests.java | Added a new parameterized test to verify token acquisition when claims are provided. |
| msal4j-sdk/src/main/java/com/microsoft/aad/msal4j/ManagedIdentityParameters.java | Extended parameters to support claims and updated the associated methods accordingly. |
| msal4j-sdk/src/main/java/com/microsoft/aad/msal4j/ManagedIdentityApplication.java | Added a clientCapabilities field and a new builder method to support client capabilities in the application. |
Comments suppressed due to low confidence (1)
msal4j-sdk/src/main/java/com/microsoft/aad/msal4j/ManagedIdentityApplication.java:119
- The Builder's clientCapabilities field is set but not explicitly propagated to the ManagedIdentityApplication instance in its constructor. Verify that the clientCapabilities value is assigned and used appropriately in the token acquisition logic.
return new ManagedIdentityApplication(this);
gladjohn
reviewed
Apr 2, 2025
msal4j-sdk/src/main/java/com/microsoft/aad/msal4j/ManagedIdentityApplication.java
Outdated
Show resolved
Hide resolved
msal4j-sdk/src/main/java/com/microsoft/aad/msal4j/ManagedIdentityApplication.java
Outdated
Show resolved
Hide resolved
msal4j-sdk/src/main/java/com/microsoft/aad/msal4j/ManagedIdentityApplication.java
Outdated
Show resolved
Hide resolved
msal4j-sdk/src/main/java/com/microsoft/aad/msal4j/ManagedIdentityParameters.java
Show resolved
Hide resolved
msal4j-sdk/src/main/java/com/microsoft/aad/msal4j/ManagedIdentityParameters.java
Show resolved
Hide resolved
msal4j-sdk/src/test/java/com/microsoft/aad/msal4j/ManagedIdentityTests.java
Outdated
Show resolved
Hide resolved
msal4j-sdk/src/test/java/com/microsoft/aad/msal4j/ManagedIdentityTests.java
Show resolved
Hide resolved
msal4j-sdk/src/test/java/com/microsoft/aad/msal4j/ManagedIdentityTests.java
Outdated
Show resolved
Hide resolved
msal4j-sdk/src/test/java/com/microsoft/aad/msal4j/ManagedIdentityTests.java
Show resolved
Hide resolved
msal4j-sdk/src/test/java/com/microsoft/aad/msal4j/ManagedIdentityTests.java
Show resolved
Hide resolved
Contributor
|
The new features for client capabilities and claims looks great. Adding tests for edge cases (like empty or malformed JSON) will strengthen the code coverage further. Excellent job!!! |
Contributor
|
nit: would be also good to have a tracking item in the PR description. |
Avery-Dunn
reviewed
Apr 2, 2025
msal4j-sdk/src/main/java/com/microsoft/aad/msal4j/ManagedIdentityApplication.java
Outdated
Show resolved
Hide resolved
gladjohn
requested changes
Apr 2, 2025
Contributor
gladjohn
left a comment
There was a problem hiding this comment.
when claims are present, we need to bypass MSALs cache
gladjohn
previously approved these changes
Apr 8, 2025
Avery-Dunn
reviewed
Apr 8, 2025
msal4j-sdk/src/main/java/com/microsoft/aad/msal4j/ManagedIdentityParameters.java
Show resolved
Hide resolved
Avery-Dunn
approved these changes
Apr 9, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add APIs to the managed identity app and request to add client capabilities and claims. Bypass the cache when claims are passed.