feat(providers): add Azure OpenAI Entra authentication - #507
Open
wgu9 wants to merge 1 commit into
Open
Conversation
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.
Summary
azure-identityFixes #457.
Implementation
The provider registry remains the single source of truth for both authentication modes. Its existing
show_whenschema selects the active fields, and the server uses the same schema to validate and determine configuration state.For Microsoft Entra ID, OpenWorker builds an official
ClientSecretCredentialandget_bearer_token_providercallback for the Azure OpenAI scope. That callback is passed directly to the OpenAI SDK, which obtains and refreshes tokens as needed; there is no custom token cache or refresh loop.The Settings flow now:
/openai/v1custom endpoint for that mode;GET /modelsbefore saving.The client secret remains in the existing local secret store and is never returned in provider
values. The packaged server explicitly collectsazure.identity, and the README documents the endpoint and required Azure role.Validation
pytest -q: 1179 passed, 1 skippednpm test: 114 passednpx playwright test e2e/provider-keys.spec.ts: 4 passed, including the new end-to-end auth-method switch/save flownpm run build: passedcollect_all("azure.identity")smoke check: passed (85 hidden imports collected)⌘B toggles the sidebar collapse); the same failure reproduces on untouchedorigin/mainin this environmentThe Entra credential/token and Azure HTTP boundaries are regression-tested with mocks. I did not have live Azure tenant credentials, so this PR does not claim a live-tenant integration test.
Screenshots
Before
OpenAI only exposed the API-key form.
After
The same provider now offers a Microsoft Entra ID mode without duplicating the provider or settings flow.
References