msgraph-sdk-dotnet
msgraph-sdk-dotnet copied to clipboard
Encoding of pound character for external users
Please provide the following (and please check them off the list with [x]) before submitting this issue:
- [x] Expected behavior. Please provide links to the specific Microsoft Graph documentation you used to determine the expected behavior.
- [x] Actual behavior. Provide error codes, stack information, and a Fiddler capture of the request and response (please remove personally identifiable information before posting).
- [x] Steps to reproduce the behavior. Include your code, IDE versions, client library versions, and any other information that might be helpful to understand your scenario.
Expected behavior
Dotnet SDK to encode pound character so queries to external users work.
Actual behavior
Dotnet SDK doesn't encode pound character which results in a null return value.
Steps to reproduce the behavior
- Invite an external user to your organization (in my case I invited the user [email protected] to the org baywet.onmicrosoft.com)
- Try to query the external user like this
var user = await client.Users["vincent_2tolead.com#EXT#@baywet.onmicrosoft.com"].Request().GetAsync(); // this will not return the user
var user2 = await client.Users["vincent_2tolead.com%23EXT%[email protected]"].Request().GetAsync(); // this will return the user
Thank you @baywet for bringing this up.
@MIchaelMainer any updates on this? I'm running into this as well with the encoding for mailbox extensions ([email protected]). The query fails, if I run trace it via App Insights and run the Graph query manually replacing +
for %2B
it works.
Related to https://github.com/microsoftgraph/msgraph-sdk-dotnet/issues/1515
Closing this one for now as this is resolved with V5 of the SDK which uses URL templates that automatically encode the URL segments based on the HTTP specification