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 9309367
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T00:50:54+00:00 2026-06-19T00:50:54+00:00

I am trying to use a custom MembershipProvider with ASP MVC to secure controllers

  • 0

I am trying to use a custom MembershipProvider with ASP MVC to secure controllers in my app.

Just for some background, I am going to use a web service eventually to authenticate each user.

As I understand it, I add it to the root level web.config as follows:

<authentication mode="Forms">
  <forms loginUrl="~/Login/Login" timeout="2880" />
</authentication>
<membership defaultProvider="CustomMembershipProvider">
  <providers>
    <clear/>
    <add name="MyMembershipProvider" type="DANet.security.MyMembershipProvider" />
  </providers>
</membership>

And here is my class:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;

namespace DANet.security
{
    public class MyMembershipProvider : MembershipProvider
    {
        private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

        public override bool ValidateUser(string username, string password)
        {
            log.Debug("MyMembershipProvider");

            throw new NotImplementedException();
        }

        public override MembershipUser CreateUser(string username,
           string password, string email, string passwordQuestion,
           string passwordAnswer, bool isApproved,
           object providerUserKey, out MembershipCreateStatus status)
        {
            log.Debug("MyMembershipProvider");
            throw new NotImplementedException();
        }

        public override string ApplicationName
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        public override bool ChangePassword(string username, string oldPassword, string newPassword)
        {
            log.Debug("MyMembershipProvider");
            throw new NotImplementedException();
        }

        public override bool ChangePasswordQuestionAndAnswer(string username, string password, string newPasswordQuestion, string newPasswordAnswer)
        {
            log.Debug("MyMembershipProvider");
            throw new NotImplementedException();
        }

        public override bool DeleteUser(string username, bool deleteAllRelatedData)
        {
            log.Debug("MyMembershipProvider");
            throw new NotImplementedException();
        }

        public override bool EnablePasswordReset
        {
            get { throw new NotImplementedException(); }
        }

        public override bool EnablePasswordRetrieval
        {
            get { throw new NotImplementedException(); }
        }

        public override MembershipUserCollection FindUsersByEmail(string emailToMatch, int pageIndex, int pageSize, out int totalRecords)
        {
            log.Debug("MyMembershipProvider");
            throw new NotImplementedException();
        }

        public override MembershipUserCollection FindUsersByName(string usernameToMatch, int pageIndex, int pageSize, out int totalRecords)
        {
            log.Debug("MyMembershipProvider");
            throw new NotImplementedException();
        }

        public override MembershipUserCollection GetAllUsers(int pageIndex, int pageSize, out int totalRecords)
        {
            log.Debug("MyMembershipProvider");
            throw new NotImplementedException();
        }

        public override int GetNumberOfUsersOnline()
        {
            log.Debug("MyMembershipProvider");
            throw new NotImplementedException();
        }

        public override string GetPassword(string username, string answer)
        {
            log.Debug("MyMembershipProvider");
            throw new NotImplementedException();
        }

        public override MembershipUser GetUser(string username, bool userIsOnline)
        {
            log.Debug("MyMembershipProvider");
            throw new NotImplementedException();
        }

        public override MembershipUser GetUser(object providerUserKey, bool userIsOnline)
        {
            log.Debug("MyMembershipProvider");
            throw new NotImplementedException();
        }

        public override string GetUserNameByEmail(string email)
        {
            log.Debug("MyMembershipProvider");
            throw new NotImplementedException();
        }

        public override int MaxInvalidPasswordAttempts
        {
            get { throw new NotImplementedException(); }
        }

        public override int MinRequiredNonAlphanumericCharacters
        {
            get { throw new NotImplementedException(); }
        }

        public override int MinRequiredPasswordLength
        {
            get { throw new NotImplementedException(); }
        }

        public override int PasswordAttemptWindow
        {
            get { throw new NotImplementedException(); }
        }

        public override MembershipPasswordFormat PasswordFormat
        {
            get { throw new NotImplementedException(); }
        }

        public override string PasswordStrengthRegularExpression
        {
            get { throw new NotImplementedException(); }
        }

        public override bool RequiresQuestionAndAnswer
        {
            get { throw new NotImplementedException(); }
        }

        public override bool RequiresUniqueEmail
        {
            get { throw new NotImplementedException(); }
        }

        public override string ResetPassword(string username, string answer)
        {
            log.Debug("MyMembershipProvider");
            throw new NotImplementedException();
        }

        public override bool UnlockUser(string userName)
        {
            log.Debug("MyMembershipProvider");
            throw new NotImplementedException();
        }

        public override void UpdateUser(MembershipUser user)
        {
            log.Debug("MyMembershipProvider");
            throw new NotImplementedException();
        }
    }
}

I just want to see if the class is being utilized by NET and being called. As you can see, I have log statements in every method and nothing is getting logged when I log in OR when I try to hit a controller method marked as [Authorize]. Am I missing something?

  • 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-19T00:50:55+00:00Added an answer on June 19, 2026 at 12:50 am

    Change the defaultProvider attribute to your membership-provider:

    <membership defaultProvider="MyMembershipProvider">
    

    Configuring an ASP.NET Application to Use Membership

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

Sidebar

Related Questions

Im trying switch the Visual Studio asp.net mvc web app template to use MySql
I am trying to self bind MembershipProvider in ASP.NET MVC 2 and then use
We are trying to use custom routes in an ASP.NET MVC application to generate
Im trying to use a custom font using @font-face and for some reason its
I'm trying to use Ninject to provide my custom MembershipProvider with an instance of
I'm trying to use a custom role provider in an MVC3 app. I've already
I'm trying to use a custom font in my iPhone app. I created a
I'm trying to use custom validator with my Rails 3 app. Here are my
I'm trying to use a custom class (be.myname.rssreader.util.Global) extending android.app.Application, but when I try
I'm trying to use a custom font in a Windows 8 C#-XAML Metro App,

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.