How can an authenticated user has no password set in the asp.net core mvc template

De openkb
Aller à : Navigation, rechercher

Sommaire

Questions

When I create a asp.net core mvc project template with user auth added and I go to the ManageController.Index action:

 bool HasPassword = await _userManager.HasPasswordAsync(user)

it is asking the userManager service wether the logged in user has a password!

Is that a template bug? How can a logged in user has no password?

The ManageController is annotated with Authorize-Attribute...

Answers

if the application uses social authentication such as Facebook, Google, Twitter, Microsoft etc then the user may not have a local password. The user can add a local password later and then be able to login to the same account without using social authentication.

Source

License : cc by-sa 3.0

http://stackoverflow.com/questions/39232146/how-can-an-authenticated-user-has-no-password-set-in-the-asp-net-core-mvc-templa

Related

Outils personnels
Espaces de noms

Variantes
Actions
Navigation
Outils