How to use ASP.NET Identity without a database

前端 未结 1 833
逝去的感伤
逝去的感伤 2020-12-28 16:15

I am trying to implement custom authentication using the new ASP.NET Identity in an MVC 5 project.

I have a single username and password that I want

1条回答
  •  误落风尘
    2020-12-28 17:05

    You don't have to migrate to Identity framework, FormsAuthentication still works. And Andrew is correct, using Identity framework makes little sense here, since it is all about managing users.

    However, if you insist on using it, you can implement your own UserManager and IUserStore. Some guidance can be found in Scott K. Allen blog post. See the links on the bottom - samples of implementations - you can take some of these and convert to your needs.

    I would imagine your IUserStore will be simple, because there is only one user and most of the methods don't have to be implemented. And for the ones required (I think you'll need FindUserById and related) you'll need to reach to web.config via ConfigurationManager

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