Issue implementing Sitefinity Membership Data provider - Front- & Back-End Development - Front- & Back-End Development - Progress Community
 Front- & Back-End Development

Issue implementing Sitefinity Membership Data provider

  • Issue implementing Sitefinity Membership Data provider
  • Hi,
    On following this documentation www.sitefinity.com/.../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

  • Thank you for replying so quickly,
    I've been using the fully coded custom provider, replacing all required data logic (www.sitefinity.com/.../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.
  • 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
  • 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 www.sitefinity.com/.../create-the-custom-membership-provider-class , also implemented GetUsers() method returning an empty IQueryable. I've added new provider described in docs.sitefinity.com/custom-membership-provider-add-the-new-provider-to-the-sitefinity-providers-collection, I've created Login page based on 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.
  • 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
     
  • Thank you for the answer. It was very useful. It work out.

    BR,
    Andreja