When an tenant has 2FA enabled, it's not able for automation API testing. So when a tenant has 2FA enabled, could particular user account has it disabled? If yes, which database table shall I check the value? Is there admin UI for it?
Or do you have any other better idea for backend API automation testing?
6 Answer(s)
-
0
Yes, in ABP, even if a tenant has 2FA enabled or enforced, you can disable 2FA for a specific user account. This allows you to perform automation API testing with that user while keeping 2FA enabled for others.
You can manage this via the admin UI:
- As a tenant admin, go to the Identity > Users page (
/Identity/Users). - Select the user you want to configure.
- Edit the user and set the "Two Factor Enabled" option to off/disabled for that user.
- As a tenant admin, go to the Identity > Users page (
In the database, the relevant value is stored in the
AbpUserstable, in theTwoFactorEnabledcolumn. Setting this column tofalsefor a user disables 2FA for that user, regardless of the tenant-wide setting.This approach is recommended for backend API automation testing: create a dedicated test user with 2FA disabled, while keeping 2FA enabled for real users.
Sources:
This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.
-
0
For above test account, could user password set to never expire?
-
0
Hi DominaTang,
Before answering your question, I would like to ask you a question. In which environment do you run your automation tests? Do you run them on the live application or do you have a test environment where you run them?
-
0
We are using QA environment for automation test.
-
0
You can configure longer token lifetimes in your QA environment using the following example:
#if QA_BUILD PreConfigure<OpenIddictServerBuilder>(builder => { builder.SetAuthorizationCodeLifetime(TimeSpan.FromDays(365)); builder.SetAccessTokenLifetime(TimeSpan.FromDays(365)); builder.SetIdentityTokenLifetime(TimeSpan.FromDays(365)); builder.SetRefreshTokenLifetime(TimeSpan.FromYears(2)); }); #endifFor more details, please check the documentation here: https://abp.io/docs/latest/modules/openiddict#setting-tokens-lifetime
-
0
thank you very much it's very helpful.