Open Closed

User is null when using two-factor login #869


User avatar
0
Johannes created
  • ABP Framework version: v3.3.0
  • UI type: Angular
  • DB provider: EF Core

We've implemented our own login controller for use by an external app. The login endpoint uses the signinmanager: protected SignInManager<Volo.Abp.Identity.IdentityUser> SignInManager { get; } And logs in:

var signInResult = await SignInManager.PasswordSignInAsync(
                login.UserNameOrEmailAddress,
                login.Password,
                login.RememberMe,
                true
);

This works fine for users without 2-factor enabled. When 2-factor is enabled, we get the expected 2-factor cookie back:

Which we then provide in the header when calling a SendSmsSecurityCode endpoint.

This it where we get confused: SignInManager.GetTwoFactorAuthenticationUserAsync() returns null. How can this happen? Are we doing something wrong?

Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

4 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Can you set a break poing at SendSmsSecurityCode method to confirm that cookies are sent.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    Johannes created

    The Identity.TwoFactorUserId cookie is included as seen here

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi @Johannes

    Can you share a simple project to reproduce this problem? liming.ma@volosoft.com

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    Johannes created

    We fixed it, it was a problem with multitenancy.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on September 28, 2026, 11:44
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.