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.

Made with ❤️ on ABP v9.1.0-preview. Updated on December 13, 2024, 06:09