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

Forums / Developing with Sitefinity / Issue implementing Sitefinity Membership Data provider

Issue implementing Sitefinity Membership Data provider

6 posts, 0 answered
  1. Simon
    Simon avatar
    2 posts
    Registered:
    05 Aug 2013
    11 Sep 2013
    Link to this post
    Hi,
    On following this documentation http://www.sitefinity.com/documentation/documentationarticles/create-the-custom-membership-provider-class, i had a problem. I've added my custom MembershipDataProvider into sitefinity administration, in my webconfig, and it appears on securityconfig.config too, as enabled. But it doesn't shows up, on the Login screen neither in the Users managing  page. I'm using Forms Authentication, and want sitefinity to use my Membership for login.
    I'm not sure of which "information" i have to provide in those two fields, application Name and Type.
    Thanks

  2. Daniel Plomp
    Daniel Plomp avatar
    952 posts
    Registered:
    18 Feb 2004
    11 Sep 2013 in reply to Simon
    Link to this post
    Hi Simon,

    You only have to add the provider into the Sitefinity Administration, which will then update the SecurityConfig.config file automatically.

    I didn't test this with Forms Authentication myself, but it should be working the same as when working with Claims Authentication.

    The ApplicationName property you can define yourself. As long this is the same as the name you defined in your custom membership class. The ProviderType is the assembly name of your class, so if you followed the structure of the tutorial, you will be good. Otherwise you will have to adjust that.

    Let me know if you have any questions. Be sure to check the ApplicationName to be identical in both places.

    Kind regards,
    Daniel
  3. Simon
    Simon avatar
    2 posts
    Registered:
    05 Aug 2013
    11 Sep 2013
    Link to this post
    Thank you for replying so quickly,
    I've been using the fully coded custom provider, replacing all required data logic (http://www.sitefinity.com/documentation/documentationarticles/full-code-of-the-custom-provider).  Using as providerName : membershipDataProvider and applicationName /membershipDataProvider, and ManagerType = "Telerik.Sitefinity.Security.UserManager" (not sure it's the right one).

    Edit: Commenting out, membershipprovider section in webconfig, let the dropdownList appear on login screen... But it shows up Default and AspNetSqlMembershipProvider. (It only appears in IIS,  inherited providers)
    I've absolutely no reference to this Name in my solution.

    Re-Edit: I'm getting this error now : BusinessRules.Security.membershipDataProvider is not interceptable.
  4. Andreja
    Andreja avatar
    2 posts
    Registered:
    09 Apr 2015
    24 Jul 2015
    Link to this post
    Hi,
    I'm trying to implement CustomMembershipProvider, I need to override ValidateUser(userName, password) method, to use my own service for validation, and it's never reached. Can anyone tell me the right way to get it work ?

    I've implemented provider described in http://www.sitefinity.com/documentation/documentationarticles/create-the-custom-membership-provider-class , also implemented GetUsers() method returning an empty IQueryable. I've added new provider described in http://docs.sitefinity.com/custom-membership-provider-add-the-new-provider-to-the-sitefinity-providers-collection, I've created Login page based on http://docs.sitefinity.com/custom-membership-provider-create-the-public-login-page-that-uses-the-new-provider, I have set MembershipProvider to "CustomMembershipProvider".

    1. CustomMembershipProvider ctor - fires
    2. GetUsers() method returning an empty IQueryable - fires
    3. ValidateUser(userName, password) - never fire (on Login page getting message "Incorrect Username/Password Combination")

    Thanks.
  5. Nikola Zagorchev
    Nikola Zagorchev avatar
    424 posts
    Registered:
    08 Dec 2016
    29 Jul 2015
    Link to this post
    Hello Andreja,

    We first try to find the user using the username entered - this is why GetUser(string username) and GetUsers are invoked, if we find the user, we try to validate it against the password, so we invoke the ValidateUser(User user, string password) overload of the ValidateUser, so you need to override this method.

    Regards,
    Nikola Zagorchev
    Telerik
     
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
     
  6. Andreja
    Andreja avatar
    2 posts
    Registered:
    09 Apr 2015
    29 Jul 2015 in reply to Nikola Zagorchev
    Link to this post
    Thank you for the answer. It was very useful. It work out.

    BR,
    Andreja
6 posts, 0 answered