Open Closed

Question on separate databases per tenant #4703


User avatar
0
balessi75 created

ABP Commercial 7.0.1 / Blazor Server / EF / Non tiered / Seperated Host and Tenant DBs

We have a requirement for every tenant to have its own separate database were we cannot use SQL server's integrated security in each tenant's connection string. Therefore, a user name and password needs to be specified in each tenant connection string defined in the SaasTenantConnectionStrings table on the host DB.

Because of this, we have a requirement to encrypt the connection string in the SaasTenantConnectionStrings table.

What is the recommended approach to allow for the connection string to be encrypted when adding/saving a tenant. Additionally what would need to be overridden/replaced in order for the framework to be able to decrypt the connection string when working with a tenant?

Thanks in advance!


1 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    What is the recommended approach to allow for the connection string to be encrypted when adding/saving a tenant. Additionally what would need to be overridden/replaced in order for the framework to be able to decrypt the connection string when working with a tenant?

    hi

    These methods of ITenantAppService are used to add/update ConnectionStrings.

    
    public interface ITenantAppService
    {
        //... 
        
        Task<SaasTenantDto> CreateAsync(SaasTenantCreateDto input);
    
        Task<SaasTenantConnectionStringsDto> GetConnectionStringsAsync(Guid id);
    
        Task UpdateConnectionStringsAsync(Guid id, SaasTenantConnectionStringsDto input);
        //... 
    }
    

    MultiTenantConnectionStringResolver is used to get ConnectionStrings.

    You can try to override the above services.

Learn More, Pay Less
33% OFF
All Trainings!
Get Your Deal
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.0.0-preview. Updated on September 16, 2025, 10:35