1

If I have an MVC application that has an authenticated user, and either from client-side JavaScript, or from an MVC controller, I wish to call a Web API that is in a different project to the MVC application, but use the same user credentials.

How would I go about this?

I am using the latest in VS2013 - MVC 5 with Web API 2. Currently to authenticate I am using forms auth.

1 Answer 1

0

Please refer the following link to solve your problem

Works fine for me

Web api authentication and MVC 4

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

2 Comments

How do I send the forms auth cookie to the web api?
You need to configure your applications to share the authentication cookie see. This as well as the proposed solution above assumes that the both projects (web sites) are on the same server (machine).

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.