Base solution for your next web application
Open Closed

Encrypted CN - in appsettings.json #7517


User avatar
0
deltavision created

Hi,

when you have a tenant with a separate database - the connection string to the tenant database is stored encrypted in the host->tenant table.

Is it possible to use the same kind of encryption in the appsettings.json file?

And if possible - how to encrypt the CN ?

E.g.

Thanks


6 Answer(s)
  • User Avatar
    0
    musa.demir created

    Where do you want to store decrypted string?

  • User Avatar
    0
    deltavision created

    Hi,

    don't wish to store the decrypted CN string - just want to be able to create an encypted CN string (from normal CN)

    And then ANZ load/connect should decrypt the encrypted string - to the "real" CN.

  • User Avatar
    0
    musa.demir created

    As i know its not implemented. You can override IConnectionStringResolver. See: https://github.com/aspnetboilerplate/aspnetboilerplate/blob/dev/src/Abp.Zero.EntityFramework/Zero/EntityFramework/DbPerTenantConnectionStringResolver.cs

    You can also create an issue on github.

  • User Avatar
    0
    deltavision created

    Thank you - for input.

    Closing the case.

  • User Avatar
    0
    leonkosak created

    If connection string in appsettings.json would be encrypted for host database, how can system admin encrypt changed connection string and replace old one? For tenant it's simple, because C# logic makes encryption and decryption logic.

  • User Avatar
    0
    deltavision created

    Hi,

    you would need a tool / function to create the encrypted string from the "real" connection string