Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Michael Worrall 57 posts 82 karma points
    Feb 09, 2012 @ 15:24
    Michael Worrall
    0

    Integrating with members that exist in another system. (Best approach???)

    I have a client who wants website members information to exist in an external system.  The members are to be able to login to my umbraco website but the authentication is going to be handled on their system.  I need a way to specify whether a user has access or not to particular pages, obviously this is complicated by the user info being elsewhere.

    So I'm wondering if anyone has done something similar to this in the past and if you could point me in the correct direction?

    Thanks,

    Mike

  • Ismail Mayat 4511 posts 10090 karma points MVP 2x admin c-trib
    Feb 09, 2012 @ 15:55
    Ismail Mayat
    0

    Mike,

    You can create your own membership provider which will authenticate on the external service. In Umbraco create your membership group and assign access to content for that group. When user logs in your custom membership provider will authenticate, then it will check if member exists in umbraco members if not then create that member using same user name and add them to the group that has access to the content.  You are kind of duplicating the data although not all of it as the member entry in umbraco is just a stub for the content access the actual authentication is happening in third party system.

    Regards

     

    Ismail

  • Michael Worrall 57 posts 82 karma points
    Feb 09, 2012 @ 16:15
    Michael Worrall
    0

    Hi Ismail,

    Thanks for that, I kind of assumed I could do something along those lines.  I assume that I'd need the 3rd party system to have a set of member groups which the members are attached to; that match those in Umbraco in order for this to work?

    Mike

  • Ismail Mayat 4511 posts 10090 karma points MVP 2x admin c-trib
    Feb 10, 2012 @ 10:50
    Ismail Mayat
    0

    Mike,

    No you would create the member groups in umbraco.  Authenticate using your third party membership,on sucessful authentication check in umbraco for user with same user id.  If they are not present then create them and assign them to the group you have already created and assigned to content.  See http://umbracoext.codeplex.com/SourceControl/changeset/view/56317#58471 namely

    Member m = Member.GetMemberFromLoginNameAndPassword(TextBoxUserName.Text, TextBoxPassword.Text);

                if (m != null)

                {

                    if (UseCookiesForAuthentication)

                        Member.AddMemberToCache(m);

                    else

                        Member.AddMemberToCache(m, true, new TimeSpan(0,0,0));

     

                    Response.Redirect(requestHandler.cleanUrl(), true);

                }

    You will replace the first line with your authentication.  Then using first line but get by username if member not null then  Member.AddMemberToCache(m); if user does not exist but is authenticated then create them in umbraco and add to the member group.

    There may be another of way of doing this but this is only one I can think of.  So you are using your third party for authentication but umbraco for the group access to content.

    Regards

     

    Ismail

     

Please Sign in or register to post replies

Write your reply to:

Draft