1

I've currently got an MVC4 site running with custom user authentication (we eventually set FormsAuthentication.SetAuthCookie) and everything works fine.

I want to move from the current setup and use a new Web API to serve the data in a REST format

my question is - using a Web API what is the best way to check if a user is logged in? say we want to just expose the Web API to another device, how could I control a user being authorized to use the API?

any help would be great!

cheers ste.

1

1 Answer 1

1

Have a look at this sample, should be exactly what you need:

http://leastprivilege.com/2012/10/23/mixing-mvc-forms-authentication-and-web-api-basic-authentication/

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.