csla: ConnectionManager does not support access tokens
Is your feature request related to a problem? Please describe.
Ideally, we would like the ConnectionManager<T> class to support .NET 4.6’s SqlConnection.AccessToken property. We’re about to start using Azure MFA authentication, so we aren’t going to be passing a User/PW but instead an Access Token. However, because ConnectionManager<T> calls new C() followed by C.Open(), there is no time to set the AccessToken property.
Describe the solution you’d like Recognizing that this would probably break pre-4.6 apps, i could imagine three options.
- Change ConnectionManager<T> to offer a virtual function we could override and set properties to prior to calling
Openwithin an inherited class. For example, on Line 148 here, make a virtual function calledOnBeforeOpen, where we could set it similar to how you do it in GetHttpClient here - Add a static event we’d listen for to set the connection’s properties prior to calling
Open. - Add a static dictionary of properties
<string PropertyName, object PropertyValue>to set with reflection prior to callingOpen.
Describe alternatives you’ve considered The only other option would be to handle the sql references ourselves, which is basically reinventing the wheel since you already offer an excellent solution.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 18 (17 by maintainers)
Thanks @rockfordlhotka, I’ll do so now. I’ve never worked with a GitHub project so there’s a little for me to learn first.