ASP.NET Web API social authentication for Web and Mobile

后端 未结 3 684
悲哀的现实
悲哀的现实 2021-01-30 00:43

My question is kind of complex so bear with me as I try to lay it out nicely what I am struggling with.

Goal

Have an ASP.NET website that lets u

3条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-30 01:27

    I am adding this as a seperate answer to the second portion of your question to say that YES you can have two separate projects tied to the same database and simply have the MVC/Web Forms website project use all cookie authentication and then have a separate Web API project that is all token authentication.

    In my longer answer with source code examples what I have basically done is combine the two separate projects into one project so as to avoid redundant model code and controller code. In my case this made more sense for me; however, I am inclined to say that it is up to personal preference and the needs of your project to dictate whether to maintain two separate projects, one website and one web API endpoint, or to combine them.

    ASP.NET was designed to be very flexible and plug and play as a middleware and I can attest that my project has existed and functioned exactly as intended with the code in two separate projects and now as one combined project.

提交回复
热议问题