Skip to content

Release 2.1.1: backport Entra caller app validation - #635

Merged
Mehak Bindra (MehakBindra) merged 2 commits into
release/v2.1from
mehakbindra-patch-release
Oct 16, 2026
Merged

Mehak Bindra (MehakBindra) merged 2 commits into
release/v2.1from
mehakbindra-patch-release

Conversation

@MehakBindra

Copy link
Copy Markdown
Member

Summary

Validation

  • Token validator tests: 45 passed using local workspace sources.
  • Ruff lint and formatting checks passed.
  • Echo example started successfully and responded over HTTP.
  • Clean dependency installation was blocked locally by PyPI TLS handshake failures; full type checking could not be completed reliably. GitHub CI must validate this backport before merge.

Release instructions

  • Merge with a merge commit, not squash, per RELEASE.md.
  • After merge, verify the release version is 2.1.1 and manually run the Azure DevOps publish pipeline on release/v2.1 with Publish Type: Public and required approval.
  • Confirm PyPI publication before creating the v2.1.1 GitHub release.
  • The release branch also contains the existing AnyIO lockfile update from Backport anyio 4.14.2 (#602) to 2.1 for security hardening #611 since v2.1.0.

No publishing is triggered by this PR.

Corina (corinagum) and others added 2 commits October 16, 2026 12:26
## Summary
Inbound activities authenticated with an Entra (Agent ID) token are now
accepted only when the token was requested by the Agent 365 platform.
The caller app is read from `azp`, or from `appid` when `azp` is absent
(v1 tokens), and compared case-insensitively. Tokens from any other
client app are rejected with 401. Bot Framework tokens are unaffected.

## Changes
`TokenValidator` checks the caller app after Entra token validation
succeeds and raises `jwt.InvalidTokenError` on mismatch.

A disallowed caller app is logged at warning level, matching TS and
.NET.

## Behavior change
Entra-authenticated activities sent from any app other than the Agent
365 platform (for example, a custom client or another bot calling the
bot's endpoint directly with an Entra token) now receive 401.

## Testing
- Unit tests for allowed `azp`, allowed `appid`, case-insensitive match,
`azp` precedence, disallowed `azp`, disallowed `appid`, missing caller
claims, and Bot Framework tokens unaffected.
- Verified locally end to end: an Entra token from a different app
registration with the bot as audience returns 401, and the activity is
not processed.

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
(cherry picked from commit 9d19ac8)
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 75921e14-a409-4a9a-bb03-08659dc023de
@MehakBindra
Mehak Bindra (MehakBindra) merged commit d6e66ec into release/v2.1 Oct 16, 2026
5 checks passed
@MehakBindra
Mehak Bindra (MehakBindra) deleted the mehakbindra-patch-release branch October 16, 2026 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants