Skip to content

[A365 support] Add Agent 365 token support - #457

Merged
heyitsaamir merged 6 commits into
feature_agent365_supportfrom
add_agent365_token_support
Jun 18, 2026
Merged

[A365 support] Add Agent 365 token support#457
heyitsaamir merged 6 commits into
feature_agent365_supportfrom
add_agent365_token_support

Conversation

@heyitsaamir

@heyitsaamir heyitsaamir commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

Adds Agent 365 agent user token support to TokenManager.

Why:
This lets apps request resource tokens for an agent identity acting through its agent user, including Teams bot API tokens.

Interesting bits:

  • Added generic get_agent_user_token(scope=...) plus get_agent_bot_token() convenience.
  • Uses MSAL's user FIC support and a client assertion callback for T1 so we don't sit on stale assertions.
  • Added an agent365 example that reads values from env vars and avoids printing the full token. tiny safety win.

Reviewer tips:
Start with packages/apps/src/microsoft_teams/apps/token_manager.py, then examples/agent365/src/main.py.

Testing:

  • uv run pytest packages/apps/tests/test_token_manager.py
  • uv run ruff check packages/apps/src/microsoft_teams/apps/token_manager.py examples/agent365/src/main.py stubs/msal/init.pyi
  • pre-commit hooks on commit: ruff, ruff format, pyright, license header

@heyitsaamir heyitsaamir changed the title Add Agent 365 token support [A365 support] Add Agent 365 token support Jun 10, 2026
@heyitsaamir
heyitsaamir changed the base branch from feature_agent365_support to agent365_support_base June 11, 2026 04:52
@heyitsaamir
heyitsaamir force-pushed the add_agent365_token_support branch from ae38af2 to 09122d9 Compare June 11, 2026 04:52
@heyitsaamir

heyitsaamir commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator Author

Comment thread packages/apps/src/microsoft_teams/apps/token_manager.py
Comment thread packages/apps/src/microsoft_teams/apps/token_manager.py
Comment thread packages/apps/src/microsoft_teams/apps/token_manager.py Outdated
Comment thread packages/apps/src/microsoft_teams/apps/token_manager.py Outdated
Comment thread packages/apps/src/microsoft_teams/apps/token_manager.py Outdated
Comment thread packages/apps/src/microsoft_teams/apps/token_manager.py Outdated
@heyitsaamir
heyitsaamir force-pushed the feature_agent365_support branch from 7f2794d to 20d15b5 Compare June 17, 2026 22:26
@heyitsaamir
heyitsaamir force-pushed the add_agent365_token_support branch from da0981d to e222f20 Compare June 17, 2026 22:26
Comment thread packages/apps/src/microsoft_teams/apps/token_manager.py Outdated
Comment thread packages/apps/src/microsoft_teams/apps/token_manager.py Outdated
Comment thread examples/agent365/README.md
@heyitsaamir
heyitsaamir merged commit 0addde5 into feature_agent365_support Jun 18, 2026
9 checks passed
@heyitsaamir
heyitsaamir deleted the add_agent365_token_support branch June 18, 2026 23:36
heyitsaamir added a commit that referenced this pull request Jun 24, 2026
Adds Agent 365 agent user token support to TokenManager.

Why:
This lets apps request resource tokens for an agent identity acting
through its agent user, including Teams bot API tokens.

Interesting bits:
- Added generic get_agent_user_token(scope=...) plus
get_agent_bot_token() convenience.
- Uses MSAL's user FIC support and a client assertion callback for T1 so
we don't sit on stale assertions.
- Added an agent365 example that reads values from env vars and avoids
printing the full token. tiny safety win.

Reviewer tips:
Start with packages/apps/src/microsoft_teams/apps/token_manager.py, then
examples/agent365/src/main.py.

Testing:
- uv run pytest packages/apps/tests/test_token_manager.py
- uv run ruff check
packages/apps/src/microsoft_teams/apps/token_manager.py
examples/agent365/src/main.py stubs/msal/__init__.pyi
- pre-commit hooks on commit: ruff, ruff format, pyright, license header
heyitsaamir added a commit that referenced this pull request Aug 3, 2026
This is the Python feature branch for Agent 365 and ACF support in 2.1.
It brings the stacked identity, lifecycle, proactive messaging, and
observability work together as one integration point.

## Included commits

-
[`24b0ffa`](24b0ffa)
Start Agent 365 support branch
-
[`ecd2654`](ecd2654)
Add Agent 365 token support (#457)
-
[`02c2091`](02c2091)
Support Entra inbound Agent ID tokens (#462)
-
[`6198553`](6198553)
Add agentic auth provider infrastructure (#485)
-
[`2f8b767`](2f8b767)
Add AgenticIdentity API surface (#478)
-
[`5ce920a`](5ce920a)
Remove ActivitySender send abstraction (#479)
-
[`b65a997`](b65a997)
Add app-level agentic send helpers (#480)
-
[`3b441b8`](3b441b8)
Default agentic app blueprint ID to app client ID
-
[`11a9bb8`](11a9bb8)
Add Agent 365 agentLifecycle event support (#492)
-
[`b5b1d44`](b5b1d44)
Fix Agent365 base branch deprecation errors
-
[`36e7c27`](36e7c27)
Simplify API client scoping (#505)
-
[`b620848`](b620848)
Add OpenTelemetry API middleware (#514)
-
[`fc4cbc0`](fc4cbc0)
Add OpenTelemetry app diagnostics (#515)
-
[`287bee1`](287bee1)
Rename Agent 365 identity surface to AgenticUser (#524)
-
[`af1b76c`](af1b76c)
Agent365 OpenTelemetry: SDK token-provider surface (#530)
-
[`3781421`](3781421)
Agent365 OpenTelemetry: Agent365 baggage bridge (#516)
-
[`c2af463`](c2af463)
Use AgenticIdentity as Python Agent 365 SDK scope (#533)

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot-Session: 56462895-549f-4889-82c7-16a7d7232ae3
Copilot-Session: b861cde5-a4a6-4d2b-9ca7-0a4f8ccda4ff
Copilot-Session: 8398c990-e5b5-41b6-8d04-0519128726c1
Copilot-Session: 0d367487-e88d-4423-8016-475637d47ed0
Copilot-Session: 69dcf0c6-166e-4c59-8a3f-6c0b0c1d8071
Copilot-Session: 69dcf0c6-166e-4c59-8a3f-6c0b0c1c05d3
Copilot-Session: a43ae3bd-97f9-4dbb-bfd0-ffc3dce0a3b7
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