Base solution for your next web application
Open Closed

Activating two factor auth for only one tenant #11390


User avatar
0
Ricavir created

Hi,

I need to activate two factor auth for one of my tenants. From my tests, if I activate two factor on host side then all tenants are also activated. How can I proceed to activate only one tenant ?

Do I need to run a database command to add a tenant setting to all tenants in order to deactivate two factor auth ?

Cheers


5 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @Ricavir

    When you enable this setting on Host side, each tenant can enable/disable this setting as well.

    Do I need to run a database command to add a tenant setting to all tenants in order to deactivate two factor auth ?

    In your case, if you want to enable it only for 1 tenant, yes, you need to do this.

  • User Avatar
    0
    Ricavir created

    Hi @Ismcagdas, thank you for your feedback.

    Can you provide an SQL command to do this stuff ? Or something similar ?

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    You can disable two factor login for all tenants other than TenantId 1 using the SQL query below. Just change the 1 with the tenantId you want to enable it for.

    INSERT INTO AbpSettings(Name, TenantId, Value, CreationTime)
    SELECT 'Abp.Zero.UserManagement.TwoFactorLogin.IsEnabled' as [Name], Id AS TenantId, 'false' AS [Value], GETDATE() AS CreationTime FROM AbpTenants WHERE Id <> 1
    
  • User Avatar
    0
    Ricavir created

    Hi

    Thank you very much @Ismcagdas :)

  • User Avatar
    0
    ismcagdas created
    Support Team

    Please reopen if that doesn't work for you :).