Suggestions for using Umbraco with an external membership system?? Options
thomwhaites
Posted: Friday, October 06, 2006 6:23:46 PM
Rank: Fanatic

Joined: 7/20/2006
Posts: 256
Location: Boston, Massachusetts
I'm building a site for our non-profit organization which has about 20,000 members. We are using Umbraco for most of the content, and a third party member managment system to track most of the member info, store purchases, join/renew, etc.

However, there are a few areas of the umbraco site which should have access restriction based on membership groups. For these pages, I'd like to basically replace the umbraco member system with our third party MMS.

Any recommendations on an approach to this task?

I wasn't able to open the RAR to look at Per's member library example, are there others around?

Thanks as always for the suggestions!
Tom
Gregorius
Posted: Tuesday, October 10, 2006 5:44:57 AM

Rank: Addict

Joined: 7/29/2006
Posts: 507
Location: Melbourne, Australia
Hey Tom,

Sounds like a huge project you've got there... i'm building a community site now, and wondering how i'm going to manage memberships etc. I'd love to chat with u in more detail, and see what you've done with your site too... could you contact me through my website - http://umbraco.psyhost.net/

cheers
greg


Wishes he could work with Umbraco all the time.
thomwhaites
Posted: Tuesday, October 10, 2006 10:50:24 PM
Rank: Fanatic

Joined: 7/20/2006
Posts: 256
Location: Boston, Massachusetts
Hey Greg,

I am working on a fairly complicated project, and I'm pretty new to .net -- nothing like jumping in head first! I'm posting here because I'd love feedback from others if I have bad ideas! Also, we're still just in house, so I can't show any site examples. This is a long post, sorry to uninterested parties.

To start, I downloaded Per's member library (the .rar gave me some trouble, but it opened with zipgenius), based on his example, here is how I'm thinking about going about integrating my two systems.

Basically, we will be using Aptify, which is a third party Member Management System. It shipped with a sample site, but the content management portion is not adequate for our needs, so we'll be using Umbraco for that part. I'm going to use controls from Aptify within Umbraco.

Getting the two applications to run together in the same web root was the first challenge since Aptify shipped with a compiled global.asax and I needed to merge both application's settings. I got around that problem using an HttpModule to handle Umbraco's global.asax stuff and I just kept the Aptify compiled global.asax.

For my member stuff, I'll mostly be using Aptify controls to handle basic authentication, join/renew stuff, meetings, store items, etc. However, I still need to restrict some sections of our CMS content to specific membership groups. To do this, I'm going to authenticate with the Aptify control, and if the authentication succeeds, I basically create an Umbraco user on the fly with group memberships mapped to my Aptify groups.

Here's a code sample, and I'd like to thank Per for the example from his member library which really helped me out!
Code:

        protected void cmdLogin_click(object sender, System.EventArgs e)
        {
            try
            {
                //use Aptify login control
                if (AptifyControl.Login(txtUserID.Text, txtPassword.Text, Page.User, 1))
                {
                    pnlLogbox.Visible = false;
                    pnlWelcome.Visible = true;
                    lblError.Text = "";
                    //save aptify session stuff
                    AptifyControl.User.SaveValuesToSessionObject(Page.Session);

                   
                    //Make an Umbraco User
                    //Pass in Aptify authenticated user name, email, member group
                    //register a member in Umbraco with these values
                    Member m = Member.MakeNew(aptifyUserName,aptifyEmail, MemberType.GetByAlias(aptifyMemberType), new umbraco.BusinessLogic.User(0));
                    m.LoginName = aptifyUserName;
                    m.AddGroup(MemberGroup.GetByName(aptifyMemberGroup).Id);

                    //Generate the members xml to save properties correctly...
                    m.XmlGenerate(new System.Xml.XmlDocument());

                    //Login
                    Member.AddMemberToCache(m);
                                        
            //fire Aptify Event Handler
                    UserLoggedIn();
                   
                    //redirect
                    Response.Redirect(Request.Url.AbsolutePath);
 
                }
                else
                {
                    pnlLogbox.Visible = true;
                    pnlWelcome.Visible = false;
                    lblError.Text = "Error logging in";
                }
            }
            catch (System.Exception ex)
            {
                Aptify.Framework.ExceptionManagement.ExceptionManager.Publish(ex);
            }
        }


        protected void cmdLogout_click(object sender, System.EventArgs e)
        {
            try
            {
                if (WebUserLogin1.Logout())
                {
                    lblError.Text = "";
                    pnlLogbox.Visible = true;
                    pnlWelcome.Visible = false;
                    AptifyControl.ClearAutoLoginCookie(Page.Response);

                   
                    //Log out Umbraco member as well
                    Member m = Member.GetCurrentMember();
                    if (m != null)
                    {
                        Member.RemoveMemberFromCache(m);
                        Member.ClearMemberFromClient(m);
                        //fire Aptify event handler
                        UserLoggedOut();
                        Response.Redirect(Request.Url.AbsolutePath);
                    }

                }

            }
            catch (System.Exception ex)
            {
                Aptify.Framework.ExceptionManagement.ExceptionManager.Publish(ex);
            }

        }



In my simple preliminary tests, this seems to work. And its nice that my editors will still be able to assign protected groups to specific nodes from the default umbraco interface.

Does anyone see any flaws, performance issues or security concerns with this approach?


Thanks!
Tom
thomwhaites
Posted: Tuesday, October 10, 2006 10:51:14 PM
Rank: Fanatic

Joined: 7/20/2006
Posts: 256
Location: Boston, Massachusetts
Hope the formatting gets fixed for that post, I can try to repost if anyone has a need.
thomwhaites
Posted: Wednesday, October 11, 2006 3:38:36 PM
Rank: Fanatic

Joined: 7/20/2006
Posts: 256
Location: Boston, Massachusetts
Question about performance:

By creating my members on the fly, a new node is entered in the UmbracoNode table for each member (and unless I modify my login logic, a new node will be created for each login). Is this going to slow down the umbraco publishing routines if my 20,000 members are all added as nodes? At what point do I need to worry about table size for SqlServer 2005?

Gregorius
Posted: Wednesday, October 18, 2006 9:52:26 AM

Rank: Addict

Joined: 7/29/2006
Posts: 507
Location: Melbourne, Australia
Hey Tom,

I'm certainly no expert at Umbraco or .Net... still fumbling my way around it too.. but my thoughts are:

1. are you sure you want to create a new user EVERY TIME a user logs in. Wouldn't it be better to store each member as Umbraco members, then authenticate against that instead of Aptify when they try to log in?
Of course if you do that, you'll need to ensure any change of passwords (or any relevant details for that matter) get logged to both databases.

2. i dont think table size is the issue with SQL server, but i know there are performance issues when you have more than around 30,000 nodes in umbraco. not sure if this includes members though, i assume it does. Perhaps one of the core devs could comment on this??

thanks for the code example.. good to see how things fit together. I've only just got my head around how umbraco works externally (doc types, templates, macros, etc)... starting to do some custom development now. My big project is a huge custom development job... but still working out how to integrate best with umbraco.

good luck mate... keep us posted with your progress.
greg


Wishes he could work with Umbraco all the time.
thomwhaites
Posted: Wednesday, October 18, 2006 3:08:49 PM
Rank: Fanatic

Joined: 7/20/2006
Posts: 256
Location: Boston, Massachusetts
Hey Greg.

I did modify the logic a bit so that a member is added to umbraco only once, although each log in, I do remove all member groups and re-add them since those may change at any time. This approach may reduce the number of members I have to deal with since not all of our organization's members actually use the web, this way a smaller number will be added on demand.

I would love to hear some comments on how these extra member nodes will impact performance. I notice that a node is added to the umbracoNode table, which I'm slowly realizing is the starting point for *everything*. But, I don't think the members are included in umbraco.xml?? Isn't this where the performance issues stem? Love to hear more comments on that!

Thanks all.

Tom
sjors
Posted: Wednesday, October 18, 2006 3:14:22 PM

Rank: Fanatic

Joined: 7/20/2006
Posts: 408
Location: Amsterdam
Hi guys, did you consider to use .NET profiling? We are using this for a huge site and its working pretty neat!
thomwhaites
Posted: Wednesday, October 18, 2006 3:21:29 PM
Rank: Fanatic

Joined: 7/20/2006
Posts: 256
Location: Boston, Massachusetts
Hi Sjors,

Your mention of .net profiling is the first I've heard of it, I'm moving to .net from a lamp environment.

Can you point me towards any information on the approach?

Thanks,
Tom
Gregorius
Posted: Thursday, October 19, 2006 2:02:46 AM

Rank: Addict

Joined: 7/29/2006
Posts: 507
Location: Melbourne, Australia
Yeah I'm also interested in this... I know what .Net profiling is, just interested in how you've integrated it into Umbraco?

which brings me back to another question i've had earlier - is it possible/ easy to create custom forms in the Umbraco backend to access (view and/or update) external data (eg: sqlprofiles in .Net)?

Wishes he could work with Umbraco all the time.
Gregorius
Posted: Thursday, October 19, 2006 11:50:42 AM

Rank: Addict

Joined: 7/29/2006
Posts: 507
Location: Melbourne, Australia
There's an awesome series of articles about .Net2 membership roles and profiles at 4GuysFromRolla - see it here: http://aspnet.4guysfromrolla.com/articles/120705-1.aspx

Wishes he could work with Umbraco all the time.
sjors
Posted: Thursday, October 19, 2006 1:03:07 PM

Rank: Fanatic

Joined: 7/20/2006
Posts: 408
Location: Amsterdam
http://www.dotnetjohn.com/articles.aspx?articleid=216

Is a pretty good explenation, i think .net Profiling is not to hard to integrate in Umbraco.
Gregorius
Posted: Thursday, October 19, 2006 1:38:22 PM

Rank: Addict

Joined: 7/29/2006
Posts: 507
Location: Melbourne, Australia
Well i guess it depends on the level of integration you're after. Have you stopped using Umbraco's Membership features alltogether and used .Net membership instead? Or have you added ActionHandlers that add members to .Net profiler when you create a new member in umbraco? Of have you created a separate section in the umbraco admin for your member management, and done it all using custom built member management admin pages through .Net profiling?

We dont need all your code, just an idea of what you did, and why you think its a good solution...

I'm also quite interested in the site you've done it on.. coudl you post the url, or send me a message through my site - umbraco.berlin.net.au ? Thanks :)

Wishes he could work with Umbraco all the time.
sjors
Posted: Thursday, October 19, 2006 1:50:05 PM

Rank: Fanatic

Joined: 7/20/2006
Posts: 408
Location: Amsterdam
Sorry, we are using profiling for a huge site, but this is not a Umbraco website (well only very smart part to handle some content).

thomwhaites
Posted: Thursday, October 19, 2006 3:12:43 PM
Rank: Fanatic

Joined: 7/20/2006
Posts: 256
Location: Boston, Massachusetts
Thanks for the information on membership/roles/profiles, etc. In our case, our member management system has already implemented all of these tasks. I already have a fully functional system for member authentication, member creation, profile updates, etc.

Either using a .net2.0 membershipprovider, or in our case, Aptify MMS, isn't the challenge of authorizing umbraco content against the external authentication model the same? I found a functional method by creating umbraco members programatically when a user logs in with the Aptify control, but is this necessary or the most efficient approach for authorizing access to specific umbraco content?

Tom
Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.