Open mdissel opened 5 years ago
What is the problem you're trying to solve?
We're connecting within the same appdomain with multiple tenants. A static variable could become a potential hard-to-find bug when the same authContext is re-used with multiple different tenants (in multiple concurrent threads!).
I would strongly suggest against having one AuthenticationManager instance being used across tenants...this will lead to other issues, especially in app-only scenarios. What I typically do is create the needed instance on the fly or keep track of the created AuthenticationManager instances and grab the one I need
that's exactly the reason for my question. Why define this variable as static?
Which PnP repository should you use to report the issue?
Category
[X] Question [ ] Bug [ ] Enhancement
Environment
[ ] Office 365 / SharePoint Online [ ] SharePoint 2016 [ ] SharePoint 2013
Expected or Desired Behavior
Why is this variable declared as static in the AuthenticationManager class?
private static AuthenticationContext _authContext = null;
https://github.com/SharePoint/PnP-Sites-Core/blob/master/Core/OfficeDevPnP.Core/AuthenticationManager.cs#L54