msgraph-sdk-dotnet icon indicating copy to clipboard operation
msgraph-sdk-dotnet copied to clipboard

Encoding of pound character for external users

Open baywet opened this issue 4 years ago • 2 comments

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

  1. Invite an external user to your organization (in my case I invited the user [email protected] to the org baywet.onmicrosoft.com)
  2. 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

AB#7300

baywet avatar Sep 05 '19 13:09 baywet

Thank you @baywet for bringing this up.

MIchaelMainer avatar Sep 10 '19 13:09 MIchaelMainer

@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.

stewartadam avatar Jul 08 '20 21:07 stewartadam

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

andrueastman avatar Mar 27 '23 12:03 andrueastman