ASP.NET Identity AuthenticationManager vs. SignInManager and cookie expiration

前端 未结 1 505
情话喂你
情话喂你 2021-01-01 10:15

What is the difference between using AuthenticationManager SignIn as opposed to using SignInManager PasswordSignIn/SignIn? I have an implementation using the SignInManager

相关标签:
1条回答
  • 2021-01-01 10:51

    Before release of identity framework version 2.1.0, we have to write our own code in order to get results (SignInStatus) for Two-Factor authentication, account lockout, EmailToBeConfirmed etc. With the SignInManager, this has been simplified and we get SignInStatus with one line of code.

    You can understand this checking following NuGet packages and compering two version.

    Version 2.0.0: Install-Package Microsoft.AspNet.Identity.Samples -Version 2.0.0-beta1 -Pre

    Version 2.1.0: Install-Package Microsoft.AspNet.Identity.Samples -Pre

    AuthenticationManager.SignIn is the mechanism using behind the SignInManager in order to complete user signIn process, so that there isn't any difference between AuthenticationManager.SignIn and SignInManager.PasswordSignIn/SignIn. We could explain SignInManager as a helper class to manage all types of authentication like PasswordSignIn/SignIn, SignInOrTwoFactor.

    Therefore expiration of cookies not depend on the method you used for signIn as all configured in the CookieAuthenticationOptions of start up.

    0 讨论(0)
提交回复
热议问题