2

I have a MVC application that my users login to that I want to return a file using a IHttpActionResult from a Web API on another server.

Is there a way to call this from the back end MVC application and return it through a MVC controller, or should the front end be calling this Web API, and if so how do I authenticate the Web API using the user logged into the MVC application so that you can only access this function if you are logged into the MVC app. The MVC application is using ASP.Identity.

Thank you.

clee
  • 121
  • 1
  • 8

1 Answers1

0

I think you can use the way in this link Web API token authentication

Basically, what you need to do is: - When user login to MVC app, grab username and password, call to your Web API to get the token => set this token to cookie. - With the token from cookie, you can easily call to Web API from your front end.

Kim Hoang
  • 1,338
  • 9
  • 24