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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T03:42:52+00:00 2026-06-15T03:42:52+00:00

I’m trying to create a custom membership provider to authenticate users in Umbraco to

  • 0

I’m trying to create a custom membership provider to authenticate users in Umbraco to an already existing database outside Umbraco. From what I’ve learned so far it should not be much more work than create a class that inherits from umbraco.providers.members.UmbracoMembershipProvider and overrides the ValidateUser() function.

What I’m wondering is how I’m supposed to do when I wish to include this class to my Umbraco project other than specify it in the web.config file? Is it possible to extend Umbraco in this way whitout re-compile the source code?

EDIT – I wrote an article about how I implemented this on http://marcus-abrahamsson.se/post/Membership-Provider-in-Umbraco

  • 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-15T03:42:53+00:00Added an answer on June 15, 2026 at 3:42 am

    You can create and build your own module and then copy the .dll into the bin folder of the Umbraco install. No need to recompile Umbraco itself.

    I had a very similar issue, but perhaps with a smaller requirement. I was trying to implement the “last logged in” functionality as described in an Umbraco TV video, to display the last logged in date of members. As the code base has changed, the described method was no longer valid. I found there were 2 general ways to get it to work:

    Create your own membership provider. Inherit from UmbracoMembershipProvider and update web config to use your provider. I overrode one method, and my provider code looked like:

    using umbraco.BusinessLogic;
    using System.Web.Profile;
    using System;
    
    namespace zo.Umb.LastLogin
    {
        // this approac works, and it may be necessary to extend the membership provider in the future, so that's why I'm
        // leaving it here. But for now I'm using the ApplicationStartupHandler event subscription method
        // in MemberEvent.cs
    
    
        /// <summary>
        /// Inherit the default membership provider and substitute my own method that's fired when a member tries
        /// to log in. Note that you must also replace the UmbracoMembershipProvider reference in the web.config 
        /// with a reference to this one. eg:
        /// <add name="UmbracoMembershipProvider" type="zo.Umb.LastLogin.MyMembershipProvider" enablePasswordRetrieval="false" enablePasswordReset="false" requiresQuestionAndAnswer="false" defaultMemberTypeAlias="Another Type" passwordFormat="Hashed" />
        /// 
        /// also note that, to have custom profile properties appear, they must also be added in the web.config
        /// like so:
        /// <profile defaultProvider="UmbracoMemberProfileProvider" enabled="true">
        ///  <providers>
        ///    <clear />
        ///    <add name="UmbracoMemberProfileProvider" type="umbraco.providers.members.UmbracoProfileProvider, umbraco.providers" />
        ///  </providers>
        ///  <properties>
        ///    <clear />
        ///    <add name="lastLogin" allowAnonymous ="false" provider="UmbracoMemberProfileProvider" type="System.DateTime" />
        ///  </properties>
        ///</profile>
    
        /// </summary>
        public class MyMembershipProvider : umbraco.providers.members.UmbracoMembershipProvider
        {
            public override bool ValidateUser(string username, string password)
            {
                var success = base.ValidateUser(username, password);
                if (success)
                {
                    var user = GetUser(username, true);
                    var profile = ProfileBase.Create(user.UserName);
                    profile["lastLogin"] = DateTime.Now;
                    profile.Save();
                }
                return success;
            }
        }
    }
    

    ValidateUser is fired when the user tries to get to secured content.

    Note that you now have to update the web.config to point to your custom membership provider.

    While this worked, I didn’t like moving off of the default provider, editing web.config, etc. and wanted to use the more “standard” approach of the previous version. So I used method 2:

    Wire into ApplicationStartupHandler, and subscribe to Member.BeforeSave

    using System;
    //using umbraco.BusinessLogic;
    using umbraco.businesslogic;
    using umbraco.cms.businesslogic.member;
    
    namespace zo.Umb.LastLogin
    {
        public class MemberEvent : ApplicationStartupHandler
        {
            public MemberEvent()
            {
                Member.BeforeSave += new Member.SaveEventHandler(Member_BeforeSave);
            }
    
            void Member_BeforeSave(Member sender, umbraco.cms.businesslogic.SaveEventArgs e)
            {
                //Log.Add(LogTypes.Debug, sender.Id, "Member_AfterAddToCache");
                sender.getProperty("lastLogin").Value = DateTime.Now;
            }
       }
    }
    

    If I recall, member.beforesave is not something that’s fired when a user is created and saved to the membership store; it’s actually fired when a user logs in.

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

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm trying to create an if statement in PHP that prevents a single post
I have a view passing on information from a database: def serve_article(request, id): served_article
Let's say I'm outputting a post title and in our database, it's Hello Y&#8217;all
I am trying to understand how to use SyndicationItem to display feed which is
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text

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.