Mvc login with Web API [closed]

2020-07-11 07:10发布

In my solution folder there are two projects

  • Myproject.API
  • Myproject.Web

API will server all the request to My Mvc web or android or IOS client.

Now Here I'm confused, Where should I Implement Authentication process.

  • At API or
  • At API and MVC both

As MVC identity uses Cookie based authentication where as API used token based.

Now What I want In Web Project, If any user try to open a page which is only for Authorize user, and if he is not logged in then he should be redirect to Login page, And It is possible when I'll MVC Identity.

If I'll Implement At API then How I'll manage cookies at Web Project.

and How I'll Send that token in every request from WEB to API

0条回答
登录 后发表回答