Combine the use of authentication both for MVC pages and for Web API pages?

后端 未结 5 1499
面向向阳花
面向向阳花 2020-12-12 21:52

I have an MVC 5 web application and can login with a Login.cshtml page and get a cookie and the login works fine. But, I would like to do a login with the Web API and then (

5条回答
  •  借酒劲吻你
    2020-12-12 22:11

    I have similar case with you, but i use a different way to authenticate.

    I have a web and an api, which all for intranet users. I do not use user's identity to pass web and api. Instead, i created a individual web account, and every time web will use this special account to connect to api.

    Because, we also need to make sure that users should not connect to api directly. They should only connect to web ui.

    Hope this help you.

提交回复
热议问题