Repository navigation
Conversation
…github-actions-credential
…github-actions-credential
…github-actions-credential
…github-actions-credential
…github-actions-credential
…github-actions-credential
|
Azure Pipelines: Successfully started running 1 pipeline(s). 34 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
🔵 Needs a closer look
The cross-package authentication addition needs human review, with unresolved async correctness issues and inconclusive API compatibility analysis.
2 open issues
What changed in this PR
Adds standalone GitHubActionsCredential support to both Java Identity packages, enabling secretless authentication through GitHub Actions OIDC federation without changing DefaultAzureCredential.
Changes:
- Adds credential builders, environment configuration, and audience mappings for six supported clouds.
- Reuses existing authentication and token-cache infrastructure, with deterministic tests and an opt-in live workflow.
- Adds compiled examples, setup and troubleshooting documentation, and release notes.
| File | Description |
|---|---|
sdk/identity/azure-identity/TROUBLESHOOTING.md |
Documents configuration and authentication failures. |
sdk/identity/azure-identity/src/test/java/com/azure/identity/GitHubActionsCredentialTest.java |
Tests token exchange, caching, failures, and request options. |
sdk/identity/azure-identity/src/test/java/com/azure/identity/GitHubActionsCredentialLiveTest.java |
Adds opt-in synchronous and asynchronous live checks. |
sdk/identity/azure-identity/src/test/java/com/azure/identity/GitHubActionsCredentialBuilderTest.java |
Tests configuration precedence, validation, and audiences. |
sdk/identity/azure-identity/src/samples/java/com/azure/identity/credential/JavaDocCodeSnippets.java |
Adds compiled credential construction examples. |
sdk/identity/azure-identity/src/main/java/com/azure/identity/GitHubActionsCredentialBuilder.java |
Resolves and validates credential configuration. |
sdk/identity/azure-identity/src/main/java/com/azure/identity/GitHubActionsCredential.java |
Implements OIDC assertion retrieval and token acquisition. |
sdk/identity/azure-identity/README.md |
Explains federation setup, cloud audiences, and live testing. |
sdk/identity/azure-identity/CHANGELOG.md |
Records the new credential feature. |
sdk/identity-v2/azure-identity/src/test/java/com/azure/v2/identity/GitHubActionsCredentialTest.java |
Tests v2 token exchange, caching, and failures. |
sdk/identity-v2/azure-identity/src/test/java/com/azure/v2/identity/GitHubActionsCredentialLiveTest.java |
Adds an opt-in v2 live authentication check. |
sdk/identity-v2/azure-identity/src/test/java/com/azure/v2/identity/GitHubActionsCredentialJavaDocCodeSnippets.java |
Provides compiled v2 documentation examples. |
sdk/identity-v2/azure-identity/src/test/java/com/azure/v2/identity/GitHubActionsCredentialBuilderTest.java |
Tests v2 configuration and audience selection. |
sdk/identity-v2/azure-identity/src/main/java/com/azure/v2/identity/GitHubActionsCredentialBuilder.java |
Adds v2 configuration resolution and validation. |
sdk/identity-v2/azure-identity/src/main/java/com/azure/v2/identity/GitHubActionsCredential.java |
Implements synchronous v2 federated authentication. |
sdk/identity-v2/azure-identity/README.md |
Documents v2 setup, usage, and troubleshooting. |
sdk/identity-v2/azure-identity/pom.xml |
Configures snippet discovery in test sources. |
sdk/identity-v2/azure-identity/CHANGELOG.md |
Records the v2 credential feature. |
.github/workflows/identity-github-actions-credential.yml |
Builds both packages and runs opt-in live authentication tests. |
Review effort: Balanced
f6ac393 to
b05b5df
Compare
| env: | ||
| AZURE_TENANT_ID: ${{ vars.AZURE_IDENTITY_GITHUB_ACTIONS_TENANT_ID }} | ||
| AZURE_CLIENT_ID: ${{ vars.AZURE_IDENTITY_GITHUB_ACTIONS_CLIENT_ID }} | ||
| AZURE_AUTHORITY_HOST: https://login.microsoftonline.com/ |
There was a problem hiding this comment.
this value is there by default for the authority host. We don't need to mention it.
| } | ||
| } | ||
|
|
||
| private static String readAssertion(Response<BinaryData> response) { |
There was a problem hiding this comment.
I was wondering that we could have error message compatibility across languages on this. https://github.com/Azure/azure-sdk-for-js/pull/38581/changes#diff-3b6a7dcba9e90d666bcd7e019746284e95303c04dbdacbc7c70fc82b924c33e5R20 These are some that are covered by JS. Maybe for cases like null or failed to pass OIDC response we can align. It just makes debugging cross language easier in case of customer reports. But this looks thorough to me.


Description
Adds
GitHubActionsCredentialandGitHubActionsCredentialBuilderto both Java Identity packages so GitHub Actions workflows can authenticate through OIDC federation without a client secret or certificate.Fixes #50642.
DefaultAzureCredentialunchanged.Adapts the reference implementation in Azure/azure-sdk-for-js#38581 to each Java package's existing builder and token APIs. No Swagger or TypeSpec regeneration is involved.
Validation
Live E2E passed on this PR head: workflow run. Both packages were built from source and executed:
Each package reported one live test, zero failures, zero errors, and zero skips. This exercised real GitHub OIDC and Entra token acquisition, including both token APIs in the existing Identity package and the synchronous v2 API. Workflow lint also passed.
The otherwise successful build logged an existing Revapi scanner error for
WindowsCredentialApi.CREDENTIAL_ATTRIBUTE.ByReference, so its API-analysis result is inconclusive. Full repository test suites were not run. The branch retains its existingmainsynchronization merge commits.All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines
Written with the help or Copilot