AB#38606 graph requests#12
Conversation
|
|
||
| [Route("api/[controller]/{*all}")] | ||
| [Route("graphproxy/{*all}")] | ||
| [Route("graphproxy/{tenantId}/{*all}")] |
There was a problem hiding this comment.
What was the reason for requiring tenantId to be in the query of every request?
There was a problem hiding this comment.
It was to have the users be able to change tenantId's as they wanted. I was following the format of other api calls by Microsoft
There was a problem hiding this comment.
Its a good idea and I agree that this might be an approach we might wanna take to support the teams app to be making the calls, but since we planned to be taking the tenantId from the user token that gets passed from authorization with Darrell, lets stick with that for now
There was a problem hiding this comment.
Makes sense!! Didn't know that, thanks for letting me know :) 3794493
| [HttpPut] | ||
| public async Task<IActionResult> PutAsync(string all, [FromBody] object body, [FromHeader] string Authorization) | ||
| [AuthorizeForScopes(Scopes = new[] { "https://graph.microsoft.com/.default" })] | ||
| public async Task<IActionResult> PutAsync(string all, [FromBody] object body, string tenantId) |
There was a problem hiding this comment.
Gotta remove tenantId from the parameter of every function
omersayshi
left a comment
There was a problem hiding this comment.
Besides removing the tenantId from the functions and resolving conflicts, looks good! again great work!
…s/gracet9182/38716-graph-requests
Overview
Demo
Postman.2021-07-20.11-09-07.mp4
Testing Instructions
appsettings.json(Note that you need to have the necessary rsc permissions in the app to run the queries)https://localhost:44399/graphproxy/{tenantId}/{graph api call suffix}https://graph.microsoft.com/. Eg. GEThttps://localhost:44399/graphproxy/{tenantId}/v1.0/will be calling GET `https://graph.microsoft.com/v1.0/ .