Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: AzureAD/microsoft-authentication-library-for-python
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1.37.0
Choose a base ref
...
head repository: AzureAD/microsoft-authentication-library-for-python
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 1.38.0
Choose a head ref
  • 18 commits
  • 25 files changed
  • 11 contributors

Commits on Jun 5, 2026

  1. Fix ESRP client ID typo in release pipeline (38d4 -> 384d) (#924)

    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    RyAuld and Copilot authored Jun 5, 2026
    Configuration menu
    Copy the full SHA
    6b652f4 View commit details
    Browse the repository at this point in the history

Commits on Jun 15, 2026

  1. Add OneBranch pipeline templates for CI and Release (#925)

    * Add OneBranch extends wrappers to CI and release pipelines
    
    - azure-pipelines.yml: extends v2/OneBranch.NonOfficial.CrossPlat.yml
    - pipeline-publish.yml: extends v2/OneBranch.Official.CrossPlat.yml
    - template-pipeline-stages.yml: remove PreBuildCheck stage (SDL now via
      globalSdl), convert pools to OneBranch syntax (type: linux, isCustom,
      ob_outputDirectory)
    
    OneBranch provides: TSA, CredScan, PoliCheck, CodeQL (Python), and
    compliance tracking. Release pipeline adds ManualValidation@1 approval
    gate before ESRP publish.
    
    Also includes ESRP client ID fix (38d4 -> 384d).
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * fix: OneBranch validation - artifact naming and parameter defaults
    
    - Rename PublishPipelineArtifact artifacts to drop_<stage>_<job> convention
    - Add default values for packageVersion and publishTarget parameters
    - Fixes pipeline queue validation errors
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * fix: use root-relative path for template reference in publish pipeline
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * fix: convert deployment job to regular job for OneBranch compatibility
    
    OneBranch custom Linux pools don't support deployment strategy (runOnce).
    Convert to a regular job with explicit artifact download.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * add .config/tsaoptions.json for OneBranch TSA upload
    
    Required by OneBranch SDL pipeline to upload security scan results to TSA.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * fix: remove isCustom pool config, use OneBranch managed pools
    
    1ES PT requires 1ES Hosted Pools for Official templates. Remove isCustom/vmImage
    and let OneBranch manage pool selection with just 'type: linux'.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * fix: replace PublishPipelineArtifact with ob_outputDirectory copy
    
    OneBranch auto-publishes artifacts from ob_outputDirectory at job end.
    Explicit PublishPipelineArtifact tasks are not allowed.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * fix: restore isCustom pool config - required for MS-hosted agents
    
    Without isCustom, OneBranch tries to run in a container using
    LinuxContainerImage variable which isn't configured. isCustom: true
    tells OneBranch to use MS-hosted agents directly.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * retrigger CI
    
    * retrigger CI
    
    * Add debug parameter for system.debug verbose logging
    
    * Fix packageVersion default: use empty string instead of space
    
    * Add PostAnalysis task to break build on PoliCheck failures
    
    ---------
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    RyAuld and Copilot authored Jun 15, 2026
    Configuration menu
    Copy the full SHA
    836abbd View commit details
    Browse the repository at this point in the history

Commits on Jun 16, 2026

  1. Fix benchmark cache path and add forceBenchmarks pipeline variable (#927

    )
    
    * Fix benchmark cache path: use directory instead of file
    
    The Cache@2 ADO task requires a directory path, but .perf.baseline was a
    file. Move baseline storage into a .perf-baseline/ directory so the cache
    task can save/restore it correctly.
    
    - Change cache path to \/.perf-baseline
    - Update test_benchmark.py to store baseline in .perf-baseline/data
    - Ensure directory exists with mkdir -p before running benchmarks
    - Update .gitignore accordingly
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Add forceBenchmarks pipeline variable to allow manual benchmark runs
    
    Allows benchmarks to run on non-dev branches by setting the pipeline
    variable forceBenchmarks=true when queuing a manual build.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Address PR review: ensure .perf-baseline dir exists in all contexts
    
    - Add os.makedirs in test_benchmark.py so local runs don't fail
    - Use absolute path in mkdir -p to align with Cache@2 path
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Address review: anchor baseline path to repo root, fix comment
    
    - Use __file__-based path resolution so baseline works from any CWD
    - Move stdlib imports before third-party imports
    - Update pipeline comment to reflect forceBenchmarks behavior
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Add 5-min step timeout to pytest to fail fast on 3.14 stalls
    
    Python 3.14 intermittently stalls during test execution, consuming the
    full 30-min job timeout. Add a 5-minute timeoutInMinutes on the pytest
    step so stalls are caught quickly instead of wasting agent time.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Address review: scope forceBenchmarks to Manual builds, add step timeout
    
    - Require Build.Reason=Manual for forceBenchmarks override (case-insensitive)
    - Add 5-min timeoutInMinutes on pytest step to catch stalls early
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    ---------
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    RyAuld and Copilot authored Jun 16, 2026
    Configuration menu
    Copy the full SHA
    2cbafaf View commit details
    Browse the repository at this point in the history
  2. Validate region string format before use in URL construction (#921)

    Add _validate_region() that checks region strings against ^[a-z][a-z0-9-]*$
    to ensure they match the Azure region naming convention. Validation is
    applied at discovery time (env var, IMDS) and before URL construction for
    user-provided azure_region values.
    
    Fixes #920
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    bgavrilMS and Copilot authored Jun 16, 2026
    Configuration menu
    Copy the full SHA
    422f9e5 View commit details
    Browse the repository at this point in the history

Commits on Jun 22, 2026

  1. Configuration menu
    Copy the full SHA
    bfd7fb7 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    62a8047 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    55dd09f View commit details
    Browse the repository at this point in the history

Commits on Jul 10, 2026

  1. Remove redundant GitHub Actions unit-test job (#942)

    * Initial plan
    
    * Remove redundant GitHub unit-test job
    
    ---------
    
    Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
    Copilot authored Jul 10, 2026
    Configuration menu
    Copy the full SHA
    8ca3c3a View commit details
    Browse the repository at this point in the history
  2. Add test coverage for past expires_on in Managed Identity (#940)

    * Add test coverage for past expires_on in Managed Identity
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Potential fix for pull request finding
    
    Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
    
    * Clarify subsequent-acquisition comment in past expires_on test
    
    Follow-up to review feedback: the second comment overstated that the token is not cached; the test proves it is not served (endpoint is re-hit), not that no entry is written.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    ---------
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
    3 people authored Jul 10, 2026
    Configuration menu
    Copy the full SHA
    b37d7dc View commit details
    Browse the repository at this point in the history

Commits on Jul 16, 2026

  1. Configuration menu
    Copy the full SHA
    d81a29a View commit details
    Browse the repository at this point in the history

Commits on Jul 20, 2026

  1. Deprecate decode_id_token and stop validating ID tokens (#911) (#943)

    * Deprecate decode_id_token and stop validating ID tokens (#911)
    
    MSAL should not perform any ID token validation. Per OpenID Connect, an ID
    token obtained via direct communication with the token endpoint (how MSAL
    retrieves tokens) does not need client-side validation, and MSAL does not
    manage sessions, so it should not check exp/iss/aud.
    
    - Add non-validating _decode_id_token_claims() and use it on the retrieval
      path (Client._obtain_token and TokenCache) so no iss/aud/exp/nbf checks run
    - Deprecate the public decode_id_token() function and Client.decode_id_token()
      method with a DeprecationWarning
    - Keep nonce and max_age/auth_time auth-code-flow replay protections
    - Update docstrings that claimed the SDK validates the ID token
    - Update tests accordingly
    
    Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
    
    * Clarify deprecation wording and add stacklevel to warning (PR #943 review)
    
    - Add stacklevel=2 so the DeprecationWarning points at the caller's site
    - Reword warning and docstrings to avoid implying this legacy helper is
      non-validating; clarify that only token acquisition stopped validating
      while decode_id_token() still performs legacy validation
    
    Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
    
    ---------
    
    Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
    4gust and Copilot authored Jul 20, 2026
    Configuration menu
    Copy the full SHA
    b299e3b View commit details
    Browse the repository at this point in the history

Commits on Aug 4, 2026

  1. Add managed identity E2E tests + self-hosted CI stages (MSAL Go #641 …

    …parity) (#948)
    
    * test(managed-identity): add real MI E2E tests + self-hosted CI stages
    
    Mirror the MSAL Go MI E2E setup (#641). Add tests/test_mi_e2e.py, which acquires
    ARM tokens for the system-assigned identity and each user-assigned binding
    (client id / resource id / object id) over IMDS, plus the system-assigned identity
    over Azure Arc, asserting the first call reaches the identity provider and the
    second is served from the cache (token_source). Uses the same lab identities as
    the Go / .NET MI E2E tests.
    
    Wire two OneBranch stages that run the test on the self-hosted lab pools
    (MISEManagedIdentity VM/IMDS and MISEAZUREARC), gated so IMDS cases run only on
    the IMDS pool (MSAL_TEST_MI_IMDS) and the Arc case only on an Arc machine; the
    test self-skips everywhere else. Exclude the E2E file from the unit stage.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    Copilot-Session: 5ad57850-7d1f-4b9a-bf9f-723d69a9687c
    
    * ci(mi-e2e): run pytest directly on self-hosted pools; drop runtime pip install
    
    The self-hosted MI E2E pools carry the toolchain (like Go/.NET); pre-provision
    msal's deps + pytest on them instead of installing at run time. This removes the
    runtime "pip install", which the Azure Arc pool cannot do anyway - its egress TLS
    inspection blocks files.pythonhosted.org (the same restriction MSAL Go documented).
    Also drop --timeout so pytest-timeout is not required.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    Copilot-Session: 5ad57850-7d1f-4b9a-bf9f-723d69a9687c
    
    * ci(mi-e2e): resolve python.exe by full path so the step doesn't depend on the agent PATH
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    Copilot-Session: 5ad57850-7d1f-4b9a-bf9f-723d69a9687c
    
    * test(mi-e2e): redact tokens in logs, close session, fork-guard self-hosted stages
    
    Address PR review feedback:
    - Assert access_token present on the cached (second) acquisition before indexing.
    - Never log token material: summarize error results to safe fields only, and
      compare the cached token to the original via SHA-256 digest instead of raw values.
    - Close the requests.Session in a finally block.
    - Add a stage-level fork guard so forked-PR code never runs on the self-hosted
      MISEManagedIdentity / MISEAZUREARC pools.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    Copilot-Session: 5ad57850-7d1f-4b9a-bf9f-723d69a9687c
    
    ---------
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    Copilot-Session: 5ad57850-7d1f-4b9a-bf9f-723d69a9687c
    gladjohn and Copilot authored Aug 4, 2026
    Configuration menu
    Copy the full SHA
    9a207a9 View commit details
    Browse the repository at this point in the history

Commits on Aug 6, 2026

  1. Fix cache key hash collision: length-prefix extended cache key compon…

    …ents (#946)
    
    * Fix cache key hash collision: length-prefix extended cache key components
    
    The extended cache key serialization concatenated sorted key+value pairs
    with no delimiters, which is not injective: distinct component sets such as
    {fmi_path: 'value'} and {fmi_pat: 'hvalue'} serialized to the same string
    and hashed to the same cache key, causing cache-slot collisions and
    redundant token re-fetches.
    
    Adopt MSAL Go's length-prefixed (netstring) encoding
    (<byteLen(key)>:<key><byteLen(value)>:<value> per sorted key, UTF-8 byte
    lengths), which is injective and byte-identical across the MSAL SDK family.
    
    * Address review: harden injectivity fuzz test
    
    Skip same-key pair combinations explicitly (a dict comprehension would
    silently overwrite and collapse intended 2-entry cases), and assert on
    len(seen) -- the count of distinct component sets exercised -- instead of
    a raw iteration counter.
    
    * Address review: clarify injectivity wording in docstrings
    
    Reword the token_cache and test docstrings to state that the length-prefix
    scheme makes the *serialization* injective (distinct inputs cannot produce
    the same pre-hash string), rather than implying absolute impossibility of a
    collision at the SHA-256 hash layer. Also quote the dict-literal examples as
    valid Python.
    4gust authored Aug 6, 2026
    Configuration menu
    Copy the full SHA
    43ed3a8 View commit details
    Browse the repository at this point in the history

Commits on Aug 11, 2026

  1. Allow Azure Arc managed identity requests to forward user-assigned id…

    …entity selectors (#944)
    
    * Initial plan
    
    * Allow Azure Arc managed identity selectors
    
    * Bump version to 1.38.0rc2
    
    Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
    
    Copilot-Session: 593fce2a-8559-422e-92e2-46fb29c251a4
    
    * Fix pipeline container
    
    * Fix pipeline host
    
    * Fix pipeline artifact management
    
    * Fix pipline artifact uploads
    
    * Fix pipeline Linux task
    
    * Refactor the Linux stuff
    
    * Fix pipeline python install
    
    * Fix pipeline python install
    
    * Remove unnecessary Python install
    
    * Update release owners
    
    * Fix Azure Arc resource-id UAMI to forward msi_res_id (not mi_res_id)
    
    Live testing against the Azure Connected Machine agent (1.67, user-assigned preview)
    showed the Arc token endpoint only honors the IMDS 'msi_res_id' spelling for the
    resource-id selector; 'mi_res_id' is silently ignored and returns the system-assigned
    identity, so a resource-id UAMI never resolved. Forward 'msi_res_id' on the Arc request
    (matching the VM/IMDS source). Update the unit test accordingly.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    Copilot-Session: 5ad57850-7d1f-4b9a-bf9f-723d69a9687c
    
    * Revert out-of-scope publish-pipeline changes; keep PR focused on Azure Arc MI
    
    The publish-pipeline edits (BuildDist Linux->Windows pool, python -m build ->
    setup.py, dropped twine check, Windows-style artifact paths on Linux pools) are
    unrelated to the Azure Arc managed identity selector forwarding this PR targets and
    were flagged in review as non-deterministic and broken on Linux. Restore
    .Pipelines/pipeline-publish.yml to the dev baseline so those concerns are removed and
    the PR only carries the Arc change.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    Copilot-Session: 5ad57850-7d1f-4b9a-bf9f-723d69a9687c
    
    * Fail closed when Azure Arc does not confirm the requested user-assigned identity
    
    Mirrors the response verification already present in MSAL .NET
    (VerifyUserAssignedIdentityWasHonored) and Go (verifyAzureArcUserAssignedIdentity),
    addressing review feedback that the Python PR only forwarded the selector without
    verifying the token response.
    
    A legacy Azure Arc agent ignores the client_id/object_id/msi_res_id selector and
    silently returns the machine's system-assigned identity. After a 200, compare the
    echoed identity (client_id/object_id/msi_res_id; mi_res_id accepted as a safety net)
    to the requested selector and raise ManagedIdentityError if missing or mismatched, so
    MSAL never returns a token for a different identity than the one requested.
    System-assigned is unaffected. Existing UAMI forwarding tests now echo the identity;
    added a fail-closed test.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    Copilot-Session: 5ad57850-7d1f-4b9a-bf9f-723d69a9687c
    
    * Update version from 1.38.0rc2 to 1.38.0
    
    ---------
    
    Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
    Co-authored-by: Nilesh Choudhary <nichoudhary@microsoft.com>
    Co-authored-by: avdunn <avdunn@microsoft.com>
    Co-authored-by: Gladwin Johnson <90415114+gladjohn@users.noreply.github.com>
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    Copilot-Session: 593fce2a-8559-422e-92e2-46fb29c251a4
    Copilot-Session: 5ad57850-7d1f-4b9a-bf9f-723d69a9687c
    5 people authored Aug 11, 2026
    Configuration menu
    Copy the full SHA
    711d8a6 View commit details
    Browse the repository at this point in the history

Commits on Aug 12, 2026

  1. Harden regional authority validation (#951)

    * Harden regional authority validation
    
    * Test Requests regional retry
    4gust authored Aug 12, 2026
    Configuration menu
    Copy the full SHA
    cd69656 View commit details
    Browse the repository at this point in the history

Commits on Aug 20, 2026

  1. fix(security): pin Service Fabric managed identity TLS (#952)

    * fix(security): pin Service Fabric managed identity TLS
    
    Validate the Service Fabric endpoint certificate thumbprint before transmitting the managed identity secret.
    
    Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
    
    Copilot-Session: bb2fb814-9e90-4d0e-a61f-caabea339e23
    
    * fix(security): address Service Fabric TLS review
    
    Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
    
    Copilot-Session: bb2fb814-9e90-4d0e-a61f-caabea339e23
    
    * fix(build): resolve package version without runtime imports
    
    Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
    
    Copilot-Session: bb2fb814-9e90-4d0e-a61f-caabea339e23
    
    ---------
    
    Copilot-Session: bb2fb814-9e90-4d0e-a61f-caabea339e23
    4gust authored Aug 20, 2026
    Configuration menu
    Copy the full SHA
    9ddae0d View commit details
    Browse the repository at this point in the history

Commits on Aug 21, 2026

  1. Configuration menu
    Copy the full SHA
    f3b6792 View commit details
    Browse the repository at this point in the history
  2. Avdunn/pipeline fix (#954)

    * Add WindowsContainerImage definition
    
    * Finish onebranch migration
    Avery-Dunn authored Aug 21, 2026
    Configuration menu
    Copy the full SHA
    b5bf153 View commit details
    Browse the repository at this point in the history
Loading