- ABP Framework version: v4.2.2
- UI type: Angular
- DB provider: EF Core
- Tiered (MVC) or Identity Server Separated (Angular): yes
- Exception message and stack trace:
- Steps to reproduce the issue:"
- Which api endpoint i can use to find if 2 factor is enabled
12 Answer(s)
-
0
-
0
Thanks @Maliming
-
0
: )
-
0
Hello Maliming, We need 2 answers:
- Which api we can use to get the 2 factor authentication provider
- which api we can use to generate and confirm the 2 factor auth token
-
0
hi
account\src\Volo.Abp.Account.Pro.Public.HttpApi\Volo\Abp\Account\AccountController.cs
[HttpGet] [Route("two-factor-providers")] public virtual Task<List<string>> GetTwoFactorProvidersAsync(GetTwoFactorProvidersInput input) { return AccountAppService.GetTwoFactorProvidersAsync(input); } [HttpPost] [Route("send-two-factor-code")] public virtual Task SendTwoFactorCodeAsync(SendTwoFactorCodeInput input) { return AccountAppService.SendTwoFactorCodeAsync(input); }
-
0
Hello Maliming, I am bit confused. i am using 4.2.2 and could not found both methods. i tried to implement it in seperate class but IAppService don't have such implementation. Please guide.
-
0
Sorry, the screenshot that I shared was the latest(5.1.x)
You can get the account and identity module source code then copy it to your project.
-
0
copy it to your project. you mean in API project or identity project?
-
0
hi
You can choose to upgrade to the latest or copy the latest 2fa code of account and identity to your project.
-
0
Hello maliming, I have copied account code for getting providers and getting 2 factor code. How i can verify the code? what is the api point
-
0
hi
await UserManager.VerifyTwoFactorTokenAsync(user, provider, code)
-
0
Thanks. it works