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.

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.