Register Default Data Sources
- 2 minutes to read
The Dashboard Configurator requires you to configure data source storage to supply users with a set of default data sources.
A user can add data sources to a dashboard after you add them to the data source storage. The Web Dashboard supports the following data source types:
Call the DashboardConfigurator.SetDataSourceStorage method to register the created data source in data source storage. You can use a predefined implementation of the in-memory storage (DataSourceInMemoryStorage) or you can implement the IDataSourceStorage interface to create custom data source storage.
Protect User Data
The Web Dashboard saves user credentials used by data sources to the dashboard XML definition.
Use the DashboardConfigurator.PassCredentials property to specify whether to pass this information to the client side (web browser). Set this property to false
and provide connection parameters in one of the following ways to avoid any security issues:
- Add a connection string to the
connectionStrings
section in the configuration file (appsettings.json
for ASP.NET Core andWeb.config
for ASP.NET MVC). - Implement the IDataSourceWizardConnectionStringsProvider interface to create a data connections provider. Pass the created provider as the DashboardConfigurator.SetConnectionStringsProvider method’s parameter. Refer to the following topic for more information: Manage Multi-Tenancy.
- Handle the DashboardConfigurator.ConfigureDataConnection event to Specify the connection parameters at runtime.