Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8979957
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T19:57:54+00:00 2026-06-15T19:57:54+00:00

Can the SimpleMembershipProvider be used with a ApiController or is it for classical web

  • 0

Can the SimpleMembershipProvider be used with a ApiController or is it for classical web pages only? When trying to use it, I get the error “Membership.Provider” property must be an instance of ExtendedMembershipProvider.

If it is compatible, how can I call the .ValidateUser method without creating a cookie like WebSecurity.Login does?

UPDATE

I got it running within a Web API scaffolding after the following changes:

  1. Web.config: outcomment the default membership & role provider within the system.web tag, as inserted by the Web API scaffolding.

  2. Change the template InitializeSimpleMebershipAttribute from a Mvc attribute to System.Web.Http.Filters. The attributes hook directly into the controller and Mvc doesn’t work for an ApiController.

However, the WebSecurity class is intermingled with forms authentication and the .Login method attaches a cookie to the http-header. WebMatrix.WebData exposes SimpleMembershipProvider, but there is no .ValidateUser to use it in a neutral way regarding authentication.

Is SimpleMembership actually intended to be used with anything else than forms authentication? I cannot find a clear answer to that on the web.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T19:57:56+00:00Added an answer on June 15, 2026 at 7:57 pm

    I think I got the answer. See the remarks section at the end of this page.

    After initializing a SimpleMembershipProvider with the WebMatrix.WebData methods, the System.Web.Security.Membership class is available, just as with the old MembershipProvider. Instead of using the WebSecurity class for validation, Membership.ValidateUser is available and no cookie attached to the http header.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can anyone tell me what i am doing wrong? I am trying to get
Can find why i get this error can someone help? package Android.data; public class
Can I change the field public virtual ClassOne ClassOne { get; set; } to
Can any one tell, how to get the result of LINQ query contains group
Can someone guide me on a possible solution? I don't want to use /bin/cp
can someone explain why the compiler accepts only this code template<typename L, size_t offset,
Can i get the source code for a WAMP stack installer somewhere? Any help
Can a LINQ enabled app run on a machine that only has the .NET
Can MOSS integrate and get user profiles from multiple Active Directory and/or LDAP stores?
Can i use a Select within a concat in xslt? eg <xsl:for-each select=root/OrderItems/lineitem> <xsl:element

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.