Skip to content

bit Boilerplate IdentityController needs performance improvements #11638

@ysmoradi

Description

@ysmoradi

Problem

The IdentityController has inefficient authentication patterns:

  1. Redundant database lookups: Using PasswordSignInAsync(userName, password, ...) causes extra FindByNameAsync queries when we already have the user object
  2. Unnecessary UserManager.UpdateAsync: Calling UpdateAsync before SaveChangesAsync adds redundant validation and database round-trips when only updating TwoFactorTokenRequestedOn
  3. Inefficient security stamp validation: ValidateSecurityStampAsync(principal) makes extra database queries to fetch the user we already have from the session query

Impact: Multiple unnecessary database queries per authentication request, reduced performance

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions