On the Asp.net Mvc 6 website, I set up a ready-made AccountController to add a custom request before calling userManager.CreateAsync() , as when registering
- with a local account (email / password) in the controller's
Register() method - with an external provider (google / facebook), in the
ExternalLoginConfirmation() controller
Now, what I would like to do, right after the user logs in,
- in the
Login() method after calling signInManager.PasswordSignInAsync() and - in
ExternalLoginCallback() after calling signInManager.ExternalLoginSignInAsync()
... to get this application, ideally, without getting into the database to get the user.
I noticed that if I look at the user immediately after logging in, the Claims collection is empty. However, if I look at this in the next controller action, the Claims collection will be populated and contain my own requirements.
The question is why the Claims are not filled immediately after logging in (I assume that the login code does not update CurrentPrincipal?), And is there another place to check immediately after logging in to receive claims without getting into the database?
source share