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?
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.
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?
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));
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.
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
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
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
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
is working on a reply...