MscrmTools.Xrm.Connection icon indicating copy to clipboard operation
MscrmTools.Xrm.Connection copied to clipboard

Allow loading connection list from external assembly

Open MarkMpn opened this issue 5 months ago • 0 comments

We currently have the option to load a connection list from a URL, which lets a web server dynamically generate the XML list of connections. However, this has a limitation of only allowing Windows authentication for that site.

This PR allows adding a .NET assembly as a connection list as well as a simple XML file. If an assembly is selected it will find a class in that assembly that implements a new ICrmConnectionsProvider interface, create an instance of that provider type and call a method on it to retrieve a list of collections. This allows organisations to implement completely custom logic to provide a list of connections. For example, a central database of connections for all their customers but different consultants have access to only the instances they require.

It also makes various methods on the ConnectionDetail class virtual. This allows the provider to return a derived class that adds extra functionality such as audit logging each time a connection is used.

I've included an example implementation within the TestWinForm app, so you can add the McTools.Xmr.Connection.TestWinForm.exe assembly as a connection list file and see an example connection.

MarkMpn avatar Jan 11 '24 11:01 MarkMpn