Is it possible to use SimpleMembershipProvider with ApiController or is it just for classic web pages? When I try to use it, I get an error. The "Membership.Provider" property must be an instance of ExtendedMembershipProvider .
If it is compatible, how can I call a method. ValidateUser without creating a cookie like WebSecurity.Login?
UPDATE
I got it as part of the web APIs after the following changes:
Web.config : issue to the default member and role provider in the system.web tag that is inserted into the web API.
Change the InitializeSimpleMebershipAttribute template from the Mvc attribute to System.Web.Http.Filters . Attributes bound directly to the controller and Mvc do not work for ApiController .
However, the WebSecurity class mixes with forms authentication, and the .Login method attaches a cookie to the http header. WebMatrix.WebData provides a SimpleMembershipProvider but no .ValidateUser to use it in a neutral way of authentication.
Is SimpleMembership actually intended to be used with anything other than forms authentication? I can not find a clear answer to this on the Internet.
Thanks!
source share