Add Workload Identity Auth Support in KV JCA#47051
Add Workload Identity Auth Support in KV JCA#47051g2vinay wants to merge 9 commits intoAzure:mainfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for Azure Workload Identity authentication for Azure Kubernetes Service (AKS) workloads in the Key Vault JCA library. This enables credential-free authentication for AKS pods using federated tokens.
Key changes:
- Implemented federated token-based authentication flow using environment variables (
AZURE_FEDERATED_TOKEN_FILE,AZURE_CLIENT_ID,AZURE_TENANT_ID) - Added automatic detection and prioritization of Workload Identity authentication
- Updated documentation with detailed authentication method examples and selection logic
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| sdk/keyvault/azure-security-keyvault-jca/src/main/java/com/azure/security/keyvault/jca/implementation/utils/AccessTokenUtil.java | Added Workload Identity support with detection logic, token file reading, and OAuth2 client assertion flow implementation |
| sdk/keyvault/azure-security-keyvault-jca/README.md | Added comprehensive authentication method documentation with examples for Service Principal, Managed Identity, and Workload Identity |
| sdk/keyvault/azure-security-keyvault-jca/CHANGELOG.md | Documented new Workload Identity feature in the unreleased version section |
...-jca/src/main/java/com/azure/security/keyvault/jca/implementation/utils/AccessTokenUtil.java
Outdated
Show resolved
Hide resolved
...-jca/src/main/java/com/azure/security/keyvault/jca/implementation/utils/AccessTokenUtil.java
Outdated
Show resolved
Hide resolved
...-jca/src/main/java/com/azure/security/keyvault/jca/implementation/utils/AccessTokenUtil.java
Outdated
Show resolved
Hide resolved
|
Any ETA for this implementation ? |
|
Hi @g2vinay. Thank you for your interest in helping to improve the Azure SDK experience and for your contribution. We've noticed that there hasn't been recent engagement on this pull request. If this is still an active work stream, please let us know by pushing some changes or leaving a comment. Otherwise, we'll close this out in 7 days. |
|
Hi Azure SDK Team, Our team is currently blocked from moving to AKS due to the absence of this feature. Please prioritize this enhancement, as it is critical for our migration plans. @g2vinay |
...-jca/src/main/java/com/azure/security/keyvault/jca/implementation/utils/AccessTokenUtil.java
Outdated
Show resolved
Hide resolved
...-jca/src/main/java/com/azure/security/keyvault/jca/implementation/utils/AccessTokenUtil.java
Outdated
Show resolved
Hide resolved
...-jca/src/main/java/com/azure/security/keyvault/jca/implementation/utils/AccessTokenUtil.java
Outdated
Show resolved
Hide resolved
rujche
left a comment
There was a problem hiding this comment.
Please update the PR according to the comments and this PR: https://github.com/Azure/azure-sdk-for-java/pull/47749/files
|
Hi @g2vinay. Thank you for your contribution. Since there hasn't been recent engagement, we're going to close this out. Feel free to respond with a comment containing |
|
Sorry, @writemevenkat, only the original author can reopen this pull request. |
|
Hi, @g2vinay I opened this PR. Could you please update this PR when you have time? |
There was a problem hiding this comment.
Again, please add the auth type of access token. And sort them by priority.
|
Thanks @rujche for the feedback, I will be addressing the feedback today for this PR. |
Thanks for following up on this feature. From there on @rujche will release this as part of next scheduled release I believe. |
|
Hi, @g2vinay , could you please resolve the conflicts in this PR? |
...-jca/src/main/java/com/azure/security/keyvault/jca/implementation/utils/AccessTokenUtil.java
Outdated
Show resolved
Hide resolved
...eyvault-jca/src/main/java/com/azure/security/keyvault/jca/implementation/KeyVaultClient.java
Outdated
Show resolved
Hide resolved
| = AccessTokenUtil.getAccessToken(resource, aadAuthenticationUri, tenantId, clientId, clientSecret); | ||
| } else if (AccessTokenUtil.isWorkloadIdentityAvailable()) { | ||
| accessToken | ||
| = AccessTokenUtil.getAccessTokenWithWorkloadIdentity(keyVaultBaseUri, tenantId, clientId, null); |
There was a problem hiding this comment.
Have you test it? If you have tested it, could you please share the screenshot to improve that it worked?
There was a problem hiding this comment.
End to end testing, requires resources setup, that is what I am currently working on.
There was a problem hiding this comment.
Again, please add the auth type of access token. And sort them by priority.
Adds Workload Identity Auth Support in KV JCA