-
Notifications
You must be signed in to change notification settings - Fork 86
Adding factory methods for app-based graph clients #481
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
Rodrigo Brandão (rodrigobr-msft)
merged 15 commits into
main
from
users/robrandao/app-graph-client
Jul 24, 2026
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
5b69751
Adding factory methods for app-based graph clients
rodrigobr-msft 39777ff
Undoing changes
rodrigobr-msft 8df48c5
Undoing formatting
rodrigobr-msft 24f81ed
Fixing issues with graph client acquisition
rodrigobr-msft 98031eb
Removing route
rodrigobr-msft 01f382b
Addressing PR feedback
rodrigobr-msft c645b12
Improving interfaces
rodrigobr-msft 26a817a
Fixing docstrings
rodrigobr-msft 8d3bf2f
Adding graph client helper tests
rodrigobr-msft c3da6f3
Minor tweak to docstrings
rodrigobr-msft 16019b7
Minor tweak to docstrings
rodrigobr-msft 35868cd
Merge branch 'users/robrandao/app-graph-client' of https://github.com…
rodrigobr-msft 10cf0c4
Formatting
rodrigobr-msft 175725e
Merge branch 'main' into users/robrandao/app-graph-client
rodrigobr-msft cca8bd4
Merge branch 'main' into users/robrandao/app-graph-client
rodrigobr-msft 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
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,32 @@ | ||
| # Teams Graph Clients Sample | ||
|
|
||
| Demonstrates creating and using Microsoft Graph clients from Teams route | ||
| handlers: | ||
|
|
||
| | Command | Graph client | Endpoint | | ||
| |---------|--------------|----------| | ||
| | `/appgraph apps` | app-only client | `GET /applications?$top=1&$select=id,appId,displayName` | | ||
| | `/usergraph me` | delegated user client | `GET /me?$select=id,displayName,userPrincipalName,mail` | | ||
| | `/signout` | delegated user auth handler | signs out the `GRAPH` handler | | ||
|
rodrigobr-msft marked this conversation as resolved.
|
||
|
|
||
| ## Permissions | ||
|
|
||
| The app-only command uses the service connection credentials and requires | ||
| Microsoft Graph application permissions such as `Application.Read.All` with | ||
| admin consent. | ||
|
|
||
| The user command uses the configured Azure Bot OAuth connection and requires | ||
| delegated Microsoft Graph permissions such as `User.Read`. | ||
|
|
||
| ## Running | ||
|
|
||
| 1. Copy `env.TEMPLATE` to `.env`. | ||
| 2. Fill in your bot/app credentials and configure the `GRAPH` OAuth connection. | ||
| 3. Start the sample: | ||
|
|
||
| ```powershell | ||
| python -m src.main | ||
| ``` | ||
|
|
||
| The server listens on `http://localhost:3978/api/messages`. Expose it with a | ||
| dev tunnel and side-load the app manifest into Teams. | ||
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,8 @@ | ||
| CONNECTIONS__SERVICE_CONNECTION__SETTINGS__CLIENTID= | ||
| CONNECTIONS__SERVICE_CONNECTION__SETTINGS__CLIENTSECRET= | ||
| CONNECTIONS__SERVICE_CONNECTION__SETTINGS__TENANTID= | ||
|
|
||
| AGENTAPPLICATION__USERAUTHORIZATION__HANDLERS__GRAPH__SETTINGS__OBOCONNECTIONNAME=SERVICE_CONNECTION | ||
| AGENTAPPLICATION__USERAUTHORIZATION__HANDLERS__GRAPH__SETTINGS__AZUREBOTOAUTHCONNECTIONNAME= | ||
|
|
||
| LOGGING__LOGLEVEL__microsoft_agents.hosting.core=INFO |
Oops, something went wrong.
Oops, something went wrong.
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.