Skip to content

Conversation

anannya03
Copy link
Member

@anannya03 anannya03 commented Aug 5, 2025

Description

Porting WorkloadIdentityCredential's auth flow to ClientAssertionCredential.

Porting Auth Flow

Please add an informative description that covers that changes made by the pull request and link all relevant issues.

If an SDK is being regenerated based on a new swagger spec, a link to the pull request containing these swagger spec changes has been included above.

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

@Copilot Copilot AI review requested due to automatic review settings August 5, 2025 23:45
@anannya03 anannya03 requested review from g2vinay, joshfree and a team as code owners August 5, 2025 23:45
@anannya03 anannya03 marked this pull request as draft August 5, 2025 23:46
Copy link
Contributor

@Copilot 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 refactors the WorkloadIdentityCredential class to use ClientAssertionCredential internally instead of the lower-level IdentityClient and IdentitySyncClient implementations. The change simplifies the implementation by delegating to an existing credential type while maintaining the same external API.

  • Replaces direct use of IdentityClient/IdentitySyncClient with ClientAssertionCredential
  • Introduces a private method to read federated tokens from files
  • Updates constructor to build ClientAssertionCredential with proper configuration transfer
Comments suppressed due to low confidence (1)

sdk/identity/azure-identity/src/main/java/com/azure/identity/WorkloadIdentityCredential.java:148

  • The new readFederatedTokenFromFile method lacks test coverage. This method handles file I/O and exception scenarios that should be thoroughly tested, including IOException handling and file reading edge cases.
    private String readFederatedTokenFromFile(String filePath) {

@anannya03 anannya03 changed the title Changes for porting Port WorkloadIdentityCredential's auth flow to ClientAssertionCredential. Aug 11, 2025
@anannya03 anannya03 force-pushed the auth_flow_clientAssertion branch from 1977cef to fbf9815 Compare August 20, 2025 01:54
@anannya03 anannya03 marked this pull request as ready for review August 20, 2025 01:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Untriaged
Development

Successfully merging this pull request may close these issues.

3 participants