[A365 support] Add Agent 365 token support#457
Merged
heyitsaamir merged 6 commits intoJun 18, 2026
Conversation
ae38af2 to
09122d9
Compare
Collaborator
Author
|
This change is part of the following stack: Change managed by git-spice. |
This was referenced Jun 11, 2026
Closed
heyitsaamir
commented
Jun 11, 2026
This was referenced Jun 13, 2026
7f2794d to
20d15b5
Compare
da0981d to
e222f20
Compare
heyitsaamir
commented
Jun 18, 2026
lilyydu
reviewed
Jun 18, 2026
lilyydu
reviewed
Jun 18, 2026
This was referenced Jun 18, 2026
lilyydu
approved these changes
Jun 18, 2026
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
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.
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:
Reviewer tips:
Start with packages/apps/src/microsoft_teams/apps/token_manager.py, then examples/agent365/src/main.py.
Testing: