Johnson Duru
Johnson Duru

Reputation: 682

Using form Authentication and Basic Authentication Authorization in Web Api

I have Built a mobile app using ASP.Net web APi. the authentication was done using Basic http authorization filter.Now the client want the app to be manage from the MVC web application. i added authorization to web application using the form authentication and membership provider which allow me to log in.

But the problem now is when i made an ajax call to the web api function that is decorated with Basic Authentication Authentication through the web application. the web application will still ask me to put password when i am already log in.

Please i want know if there any way the authorization can be done at once when i use form authentication [Authorize] on a page. your help will be appreciated.

Upvotes: 0

Views: 789

Answers (1)

leastprivilege
leastprivilege

Reputation: 18482

I have written about it here:

http://leastprivilege.com/2012/10/24/extensions-to-the-web-apimvc-formsbasic-auth-sample-claims-transformation-and-ajax/

Also make sure you read the previous post as well.

Upvotes: 1

Related Questions