+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / Custom membership provider for cross-domain authentication

Custom membership provider for cross-domain authentication

4 posts, 0 answered
  1. Artem
    Artem avatar
    1 posts
    Registered:
    17 Jan 2013
    17 Jan 2013
    Link to this post
    Hi guys. I'm trying to implement SSO for two sites at once, one of them is based on sitefinity CMS (other, obviously, dont). My approach is to develop my own membership provider, which allow me to grand access for users from other web-site to sitefinity. 

    The main problem is that I can't register or affect on the actual authentication in sitefinity by my own membership provider. Please, can you discribe step by step, what should I do, to get things work, like how should I implement my membership provider and attach it to sitefinity?

    Also, do you have any documentation for developers, which will describe this type of solution in depth? I will appreciate if you give me some links to read.

  2. Daniel Plomp
    Daniel Plomp avatar
    952 posts
    Registered:
    18 Feb 2004
    21 Jan 2013 in reply to Artem
    Link to this post
    Hi Artem,

    I did this once, and I've implemented my own membership provider by inheriting from the 'MembershipDataProvider' class.

    public class CustomMembershipProvider : MembershipDataProvider {

    Next I registered it like this:

    SecurityConfig.config
    <membershipProviders>
            <add title="Custom Membershipprovider" type="SitefinityWebApp.Providers.CustomMembershipProvider" applicationName="Membership/" enablePasswordReset="true" maxInvalidPasswordAttempts="5" minRequiredNonalphanumericCharacters="0" minRequiredPasswordLength="7" newPasswordLength="8" passwordAttemptWindow="10" passwordFormat="Encrypted" requiresQuestionAndAnswer="false" requiresUniqueEmail="true" enablePasswordRetrieval="false" enabled="True" name="WecMembershipProvider" />
        </membershipProviders>

    That would enable me to login from the public site using the custom membership provider.
    Of course you can extend this to your needs. Maybe add a custom RoleProvider also.

    Regards,
    Daniel
  3. Denis
    Denis avatar
    105 posts
    Registered:
    27 Feb 2009
    01 Feb 2013 in reply to Daniel Plomp
    Link to this post
    Hi Daniel,

    Did you add second data connection string in your configurations as well? So your custom provider can connect to another database?

    - Denis.
  4. Daniel Plomp
    Daniel Plomp avatar
    952 posts
    Registered:
    18 Feb 2004
    04 Feb 2013 in reply to Denis
    Link to this post

    Hi Denis,

     No, in this case I didn't. My MembershipProvider was getting it's data out of one of the Dynamic Modules within Sitefinity. But of course you can use a different connection string.

    Regards,
    Daniel

4 posts, 0 answered