-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Token Caching Support For Managed Identity #30282
Conversation
sdk/identity/azure-identity/src/main/java/com/azure/identity/implementation/IdentityClient.java
Outdated
Show resolved
Hide resolved
...ty/azure-identity/src/main/java/com/azure/identity/implementation/IdentityClientOptions.java
Show resolved
Hide resolved
...ty/azure-identity/src/main/java/com/azure/identity/implementation/IdentityClientOptions.java
Show resolved
Hide resolved
...ty/azure-identity/src/main/java/com/azure/identity/implementation/IdentityClientOptions.java
Outdated
Show resolved
Hide resolved
...zure-identity/src/main/java/com/azure/identity/implementation/ManagedIdentityParameters.java
Show resolved
Hide resolved
...tity/azure-identity/src/main/java/com/azure/identity/implementation/ManagedIdentityType.java
Show resolved
Hide resolved
API change check APIView has identified API level changes in this PR and created following API reviews. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Can we add better tests for the new codepath? I think the modification to the existing tests is just to ensure we hit the
getTokenFromTargetManagedIdentity
change. - In the places where a public credential type has been changed to call
authenticateWithManagedIdentityConfidentialClient
should weprivate
the correpondingIdentityClient
method? (For exampleauthenticateToArcManagedIdentityEndpoint
return clientOptions.setManagedIdentityType(ManagedIdentityType.VM); | ||
case AKS: | ||
return clientOptions.setManagedIdentityType(ManagedIdentityType.AKS); | ||
default: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is NONE
really a valid value? should this be an error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed NONE on second design iteration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm. I'm not sure that's entirely right either - now won't the default value be VM
? We probably need a NONE
or DEFAULT
to indicate the unchosen value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah in our code flow we default to VM, that's our default based on the logic we follow.
None or Unchosen are invalid states to have and are equivalent to the value being null.
sdk/identity/azure-identity/src/main/java/com/azure/identity/implementation/IdentityClient.java
Show resolved
Hide resolved
sdk/identity/azure-identity/src/main/java/com/azure/identity/implementation/IdentityClient.java
Outdated
Show resolved
Hide resolved
sdk/identity/azure-identity/src/main/java/com/azure/identity/implementation/IdentityClient.java
Outdated
Show resolved
Hide resolved
sdk/identity/azure-identity/src/main/java/com/azure/identity/implementation/IdentityClient.java
Outdated
Show resolved
Hide resolved
...zure-identity/src/main/java/com/azure/identity/implementation/ManagedIdentityParameters.java
Show resolved
Hide resolved
...tity/azure-identity/src/main/java/com/azure/identity/implementation/ManagedIdentityType.java
Outdated
Show resolved
Hide resolved
...tity/azure-identity/src/main/java/com/azure/identity/implementation/ManagedIdentityType.java
Outdated
Show resolved
Hide resolved
sdk/identity/azure-identity/src/main/java/com/azure/identity/implementation/IdentityClient.java
Outdated
Show resolved
Hide resolved
For 1. We can add some Identity Client level helper method tests, which I will push in next commit, Msal callback flow is tested on msal end For 2. It is an impl class, nothing that impacts users from API point of view, we can make it private, but won't create any user impact. |
Yeah, I was thinking to be clear about our intent that these methods are not to be used from other creds in the future. |
sdk/identity/azure-identity/src/main/java/com/azure/identity/implementation/IdentityClient.java
Show resolved
Hide resolved
sdk/identity/azure-identity/src/main/java/com/azure/identity/implementation/IdentityClient.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Integrates the Managed Identity Auth flow to use In Memory Token Caching