-
Notifications
You must be signed in to change notification settings - Fork 55
Enhance MsalAuth for multi-tenant support, update MSAL version, and add JWT decoding functionality with adaptive card integration #307
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
MattB-msft
merged 6 commits into
main
from
users/mbarbour/supportMultiTenantMultiInstanceAgentId
Feb 5, 2026
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
f0e1484
Enhance MsalAuth for multi-tenant support, update MSAL version, and a…
MattB-msft a6d05e7
Update test_samples/agentic-test/src/agent.py
MattB-msft 80960d4
Refactor: Improve regex formatting and comment clarity in MsalAuth class
MattB-msft a63c920
Merge branch 'users/mbarbour/supportMultiTenantMultiInstanceAgentId' …
MattB-msft 8aca851
Add test coverage for multi-tenant auth methods and fix regex pattern…
Copilot dcffd84
Initial plan (#310)
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| { | ||
| "type": "AdaptiveCard", | ||
| "$schema": "https://adaptivecards.io/schemas/adaptive-card.json", | ||
| "version": "1.6", | ||
| "body": [ | ||
| { | ||
| "type": "TextBlock", | ||
| "text": "Agentic Message Received - Token Decode", | ||
| "wrap": true, | ||
| "weight": "Bolder" | ||
| }, | ||
| { | ||
| "type": "TextBlock", | ||
| "text": "Token Decode:", | ||
| "wrap": true | ||
| }, | ||
| { | ||
| "type": "ColumnSet", | ||
| "columns": [ | ||
| { | ||
| "type": "Column", | ||
| "width": "stretch", | ||
| "items": [ | ||
| { | ||
| "type": "FactSet", | ||
| "facts": [ | ||
| { | ||
| "title": "Token Length", | ||
| "value": "{{length}}" | ||
| }, | ||
| { | ||
| "title": "Name", | ||
| "value": "{{name}}" | ||
| }, | ||
| { | ||
| "title": "Upn", | ||
| "value": "{{upn}}" | ||
| }, | ||
| { | ||
| "title": "Oid", | ||
| "value": "{{oid}}" | ||
| }, | ||
| { | ||
| "title": "Tid", | ||
| "value": "{{tid}}" | ||
MattB-msft marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| import json | ||
| import os | ||
|
|
||
|
|
||
| def load_adaptive_card(file_path): | ||
| """Load Adaptive Card JSON from a file with validation.""" | ||
| if not os.path.exists(file_path): | ||
| raise FileNotFoundError(f"Adaptive Card file not found: {file_path}") | ||
|
|
||
| with open(file_path, "r", encoding="utf-8") as file: | ||
| try: | ||
| card_json = json.load(file) | ||
| except json.JSONDecodeError as e: | ||
| raise ValueError(f"Invalid JSON in {file_path}: {e}") | ||
|
|
||
| return card_json | ||
|
|
||
|
|
||
| def update_card_data(card_json, data_map): | ||
| """ | ||
| Replace placeholders in the Adaptive Card JSON with actual values. | ||
| Placeholders should be in the form {{key}} in the JSON template. | ||
| """ | ||
| card_str = json.dumps(card_json) # Convert to string for replacement | ||
| for key, value in data_map.items(): | ||
| placeholder = f"{{{{{key}}}}}" # e.g., {{name}} | ||
| card_str = card_str.replace(placeholder, str(value)) | ||
|
|
||
| return json.loads(card_str) # Convert back to dict | ||
MattB-msft marked this conversation as resolved.
Show resolved
Hide resolved
MattB-msft marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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
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
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.
Uh oh!
There was an error while loading. Please reload this page.