Closed homebrew79 closed 4 years ago
Thanks for reporting an issue. I'll investigate what it might be. I believe the multi-context scenario is covered. However, it might be AddIn-Only Auth strategy specific.
After running it through delve, it appears the issue might be with the getRealm function. In my case, both of the sites I want to access reside at the same host URL with different paths. So it is reusing the cacheKey. If I comment out the caching bits, everything runs fine.
That's strange as not only host but also strategy and part of secrets act as a cache key:
cacheKey := parsedURL.Host + "@addinonly@" + c.ClientID + "@" + c.ClientSecret
if accessToken, found := storage.Get(cacheKey); found {
return accessToken.(string), nil
}
UPD: Oh, got it, getRealm
, yep this might be the root issue.
Thanks for looking into this. Here is what I'm referencing:
@homebrew79, thank you so much for assisting finding the issue, I appreciate it! Pushed the update which makes that cache key unique within the same environment and using 2 or more AddIns registrations. Could you please check is it helps you?
That seems to have fixed it. I will do some more extensive testing, but I think this can be closed. Thanks for the quick response!
Thanks for using the package!
Describe the bug Trying to use addin auth strategy across multiple sharepoint online sites. Specifically using chunked file upload. The file uploads fine to the first site, but when uploading to the second site, I receive the following error:
unable to request api: invalid character '<' looking for beginning of value
Versions Sharepoint Online github.com/koltyakov/gosip v0.0.0-20200628141644-21f34db9ce21
To Reproduce
Expected behavior Expect for file to upload to both sites without error.