Skip to content

Decision log of Identity#47466

Draft
JennyPng wants to merge 1 commit into
Azure:mainfrom
JennyPng:identity-decisions
Draft

Decision log of Identity#47466
JennyPng wants to merge 1 commit into
Azure:mainfrom
JennyPng:identity-decisions

Conversation

@JennyPng

@JennyPng JennyPng commented Jun 11, 2026

Copy link
Copy Markdown
Member

asked Copilot to analyze git history, PR descriptions, etc. to document a historical timeline of (non-obvious) decisions made when developing Identity

experiment to see if this is useful context to have in the repo for agents. would require automated agentic workflows to maintain

Prompt:

Build a decision.md file for azure-identity SDK, documenting a historical, chronological list of key architecture/design decision with relevant PR citations. Similar to a changelog, but for deeper context on why things are the way they are now. Look at major commits in git history , git blame, cross reference key PR descriptions or comment threads on those PRs for context on WHY we made any decisions. Focus not on obvious information already covered in main docs, but rather any non-obvious context to help new developers or agents understand how to work in the codebase.

@pvaneck pvaneck left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, looks pretty good. Left some comments.

Comment on lines +284 to +294
### `additionally_allowed_tenants` allowlist — defending against the confused-deputy risk
PR [#26133](https://github.com/Azure/azure-sdk-for-python/pull/26133) (2022-09)

Once per-request `tenant_id` was honored unconditionally, a malicious/compromised service
could return a challenge steering token acquisition to an attacker-controlled tenant. The fix
(`_internal/utils.py: resolve_tenant`) refuses any tenant not in `additionally_allowed_tenants`
(or `*`). A carve-out: credentials whose `default_tenant` is `"organizations"` (inherently
multi-tenant dev tools like `AzureCliCredential`) allow any tenant when no allowlist is set,
so developers using the CLI across subscriptions aren't broken. This is a **breaking
behavioral change** documented in [`BREAKING_CHANGES.md`](BREAKING_CHANGES.md) (1.11.0); the
rationale is at <https://aka.ms/azsdk/blog/multi-tenant-guidance>.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say the main intention of this change was to constrain multi-tenant authentication by default so that if a credential was configured for one tenant when constructed, then token requests for another tenant would raise an error unless explicitly allowed.

extensions). In that package, `allow_broker` defaults to `True` because installing the package
*is* the opt-in.

### `WorkloadIdentityCredential` and the `FailedDACCredential` placeholder

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FailedDACCredential was introduced in 2025, so timeline is off here: #42346


## Recurring patterns worth internalizing

- **MSAL is the source of truth.** Local workarounds for MSAL gaps are deliberate, time-boxed

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Source of truth for most sync-credentials. Async credentials don't use MSAL underneath since MSAL does not have an async API. They only use MSAL's token cache.

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.

2 participants