-
Notifications
You must be signed in to change notification settings - Fork 908
Graph RSC C# Sample SDK Updates and Fixes #1647
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
Merged
Changes from 3 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
7a4cd26
Graph RSC Sample SDK Updates and Fixes
Mohammed-MSFT 0ddab84
Fixed Merged Conflicts
Mohammed-MSFT 6729b32
Amey Tested and Updated Few Changes
Mohammed-MSFT 78f9331
Fixed PR Comment
Mohammed-MSFT 85ea2b2
Merge remote-tracking branch 'origin/main' into v-mfurquan/Graph-SDK-…
Harikrishnan-MSFT 44a4a72
Merge branch 'v-mfurquan/Graph-SDK-Sample-Fixes-4' of https://github.…
Harikrishnan-MSFT 8823f37
Merge remote-tracking branch 'origin/main' into v-mfurquan/Graph-SDK-…
Harikrishnan-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
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
121 changes: 121 additions & 0 deletions
121
samples/graph-rsc/csharp/M365Agent/build/aad.manifest.local.json
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,121 @@ | ||
| { | ||
| "id": "72c97357-4670-4e63-a1a7-ed21a2dde867", | ||
| "appId": "e5aabd5f-b79b-4e60-8dc3-090af1fa3ad2", | ||
| "name": "graph-rsc-aad", | ||
| "accessTokenAcceptedVersion": 2, | ||
| "signInAudience": "AzureADMultipleOrgs", | ||
| "optionalClaims": { | ||
| "idToken": [], | ||
| "accessToken": [ | ||
| { | ||
| "name": "idtyp", | ||
| "source": null, | ||
| "essential": false, | ||
| "additionalProperties": [] | ||
| } | ||
| ], | ||
| "saml2Token": [] | ||
| }, | ||
| "requiredResourceAccess": [ | ||
| { | ||
| "resourceAppId": "00000003-0000-0000-c000-000000000000", | ||
| "resourceAccess": [ | ||
| { | ||
| "id": "e1fe6dd8-ba31-4d61-89e7-88639da4683d", | ||
| "type": "Scope" | ||
| }, | ||
| { | ||
| "id": "9ce09611-f4f7-4abd-a629-a05450422a97", | ||
| "type": "Role" | ||
| }, | ||
| { | ||
| "id": "a267235f-af13-44dc-8385-c1dc93023186", | ||
| "type": "Role" | ||
| } | ||
| ] | ||
| } | ||
| ], | ||
| "oauth2Permissions": [ | ||
| { | ||
| "adminConsentDescription": "Allows Teams to call the app's web APIs as the current user.", | ||
| "adminConsentDisplayName": "Teams can access app's web APIs", | ||
| "id": "d51b26ab-b4af-4eb5-b868-4fc2de7c2785", | ||
| "isEnabled": true, | ||
| "type": "User", | ||
| "userConsentDescription": "Enable Teams to call this app's web APIs with the same rights that you have", | ||
| "userConsentDisplayName": "Teams can access app's web APIs and make requests on your behalf", | ||
| "value": "access_as_user" | ||
| } | ||
| ], | ||
| "preAuthorizedApplications": [ | ||
| { | ||
| "appId": "1fec8e78-bce4-4aaf-ab1b-5451cc387264", | ||
| "permissionIds": [ | ||
| "d51b26ab-b4af-4eb5-b868-4fc2de7c2785" | ||
| ] | ||
| }, | ||
| { | ||
| "appId": "5e3ce6c0-2b1f-4285-8d4b-75ee78787346", | ||
| "permissionIds": [ | ||
| "d51b26ab-b4af-4eb5-b868-4fc2de7c2785" | ||
| ] | ||
| }, | ||
| { | ||
| "appId": "d3590ed6-52b3-4102-aeff-aad2292ab01c", | ||
| "permissionIds": [ | ||
| "d51b26ab-b4af-4eb5-b868-4fc2de7c2785" | ||
| ] | ||
| }, | ||
| { | ||
| "appId": "00000002-0000-0ff1-ce00-000000000000", | ||
| "permissionIds": [ | ||
| "d51b26ab-b4af-4eb5-b868-4fc2de7c2785" | ||
| ] | ||
| }, | ||
| { | ||
| "appId": "bc59ab01-8403-45c6-8796-ac3ef710b3e3", | ||
| "permissionIds": [ | ||
| "d51b26ab-b4af-4eb5-b868-4fc2de7c2785" | ||
| ] | ||
| }, | ||
| { | ||
| "appId": "0ec893e0-5785-4de6-99da-4ed124e5296c", | ||
| "permissionIds": [ | ||
| "d51b26ab-b4af-4eb5-b868-4fc2de7c2785" | ||
| ] | ||
| }, | ||
| { | ||
| "appId": "4765445b-32c6-49b0-83e6-1d93765276ca", | ||
| "permissionIds": [ | ||
| "d51b26ab-b4af-4eb5-b868-4fc2de7c2785" | ||
| ] | ||
| }, | ||
| { | ||
| "appId": "4345a7b9-9a63-4910-a426-35363201d503", | ||
| "permissionIds": [ | ||
| "d51b26ab-b4af-4eb5-b868-4fc2de7c2785" | ||
| ] | ||
| } | ||
| ], | ||
| "identifierUris": [ | ||
| "api://localhost:44302/e5aabd5f-b79b-4e60-8dc3-090af1fa3ad2" | ||
| ], | ||
| "replyUrlsWithType": [ | ||
| { | ||
| "url": "https://localhost:44302/auth-end.html", | ||
| "type": "Web" | ||
| }, | ||
| { | ||
| "url": "https://localhost:44302/auth-end.html?clientId=e5aabd5f-b79b-4e60-8dc3-090af1fa3ad2", | ||
| "type": "Spa" | ||
| }, | ||
| { | ||
| "url": "https://localhost:44302/blank-auth-end.html", | ||
| "type": "Spa" | ||
| }, | ||
| { | ||
| "url": "https://localhost:44302/Auth/End", | ||
| "type": "Spa" | ||
| } | ||
| ] | ||
| } |
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,44 @@ | ||
| // <copyright file="GraphClient.cs" company="Microsoft Corporation"> | ||
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT license. | ||
| // </copyright> | ||
|
|
||
| using Microsoft.Graph; | ||
| using Microsoft.Kiota.Abstractions.Authentication; | ||
| using System.Collections.Generic; | ||
| using System.Threading.Tasks; | ||
| using System.Threading; | ||
| using System; | ||
|
|
||
| namespace RSCDemo.Helper | ||
| { | ||
| public class GraphClient | ||
| { | ||
|
|
||
| public class SimpleAccessTokenProvider : IAccessTokenProvider | ||
| { | ||
| private readonly string _accessToken; | ||
|
|
||
| public SimpleAccessTokenProvider(string accessToken) | ||
| { | ||
| _accessToken = accessToken; | ||
| } | ||
|
|
||
| public Task<string> GetAuthorizationTokenAsync(Uri uri, Dictionary<string, object> context = null, CancellationToken cancellationToken = default) | ||
| { | ||
| return Task.FromResult(_accessToken); | ||
| } | ||
|
|
||
| public AllowedHostsValidator AllowedHostsValidator => new AllowedHostsValidator(); | ||
| } | ||
|
|
||
| public static GraphServiceClient GetGraphClient(string accessToken) | ||
| { | ||
| var tokenProvider = new SimpleAccessTokenProvider(accessToken); | ||
| var authProvider = new BaseBearerTokenAuthenticationProvider(tokenProvider); | ||
|
|
||
| return new GraphServiceClient(authProvider); | ||
| } | ||
|
|
||
| } | ||
| } |
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
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.