Resolution when Sharepoint returns the wrong site.
Issue Description: Sharepoint returns the wrong site.
Diagnosing / Resolving: If Sharepoint is returning the wrong site, it is most likely returning the default site. For example if using a url with '/teams' instead of '/site' this could happen.
When parsing the sharepoint URL the code expects it to contain site. If that is not present, the parsed URL will return null and the default site will be connected to.
This issue can be validated with a fiddler trace. The trace will show that the call to /v1.0/sites/ returns null.