User.Identity.GetUserId() returns null after successful login May 26, 2023 by Tarik Simply try this : string userId = SignInManager .AuthenticationManager .AuthenticationResponseGrant.Identity.GetUserId();