Invalid type specified Telerik.Sitefinity.Security.Data.MembershipDataProvider
I'm getting this error with Sitefinity 4.0.992.0. I'm trying to use the aspnet role and membership tables.
The sitefinity tables are in the same database as the aspnet role and membership tables. The following are the steps taken which
result in an exception shown below.
Under Security
In Membership Providers > Create New
Name: AspNetMembershipProvider
Description:
ResourceClassId:
ProviderType: Telerik.Sitefinity.Security.Data.SitefinityMembershipProvider
Version:
In Membership Providers > Create New
Name: AspNetMembershipProvider
Description:
ResourceClassId:
ProviderType: Telerik.Sitefinity.Security.Data.SitefinityMembershipProvider
Version:
In Role Providers > Create New
Name: AspNetRoleProvider
Description:
ResourceClassId: Telerik.Sitefinity.Security.Data.SitefinityRoleProvider
ProviderType:
Version:
No back under security I set I changed DefaultBackendRoleProvider and DefaultBackendMembershipProvider from Default to the following
DefaultBackendRoleProvider - AspNetRoleProvider
DefaultBackendMembershipProvider - AspNetMembershipProvider
Not sure if I need to change DefaultSecurityProvider which is left as OpenAccessDataProvide. Any ideas would be greatly appreciated.
Thanks Sean
The following is the exception I get when I try to login:
Exception Details: System.ArgumentException: Invalid type specified Telerik.Sitefinity.Security.Data.MembershipDataProvider
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[ArgumentException: Invalid type specified Telerik.Sitefinity.Security.Data.MembershipDataProvider]
Telerik.Sitefinity.Data.ManagerBase`1.InstantiateProvider(IDataProviderSettings providerSettings, Type providerType, ExceptionPolicyName policy, ManagerBase`1 manager) +2216
Telerik.Sitefinity.Data.ManagerBase`1.InstantiateProvider(IDataProviderSettings providerSettings, ExceptionPolicyName policy, ManagerBase`1 manager) +74
Telerik.Sitefinity.Data.ManagerBase`1.SetProvider(String providerName, String transactionName) +214
[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeMethodHandle._InvokeConstructor(IRuntimeMethodInfo method, Object[] args, SignatureStruct& signature, RuntimeType declaringType) +0
System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +517
Telerik.Sitefinity.Data.ManagerBase`1.GetManager(String providerName, String transactionName) +753
Telerik.Sitefinity.Security.SecurityManager.AuthenticateUser(String membershipProviderName, String userName, String password, Boolean persistent, User& user) +50
Telerik.Sitefinity.Security.Web.UI.LoginForm.LoginForm_Authenticate(Object sender, AuthenticateEventArgs e) +240
System.Web.UI.WebControls.Login.AttemptLogin() +166
System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e) +93
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +52
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3691
9 Answers, 1 is accepted
Please take a look at this post and the references from it.
Regards,
Ivan Dimitrov
the Telerik team

Thanks for the link but there seems to be some conflicting comments and it doesn't address our scenario.
In Sitefinity 3.7 we didn't need to implement custom providers. We just used System.Web.Security.SqlRoleProvider and System.Web.Security.SqlMembershipProvider.
In the web.config under RoleManager we added a provider of type System.Web.Security.SqlRoleProvider and under Membership we added a provider of type System.Web.Security.SqlMembershipProvider. Both providers the were given the same name and were set as the default providers under roleManager and membership. Under security a provider of type Telerif.Security.Data.DefaultSecurityProvider was added. It's membership and roleProvider attributes were set to the provider names mentioned above and the connectionstringName was set to the db connectionstring where Sitefinity was installed.
This is all we wish to achive in Sitefinity 4 RC. Can this be done in the RC and if so how does it differ from above given the different config file layout and apparent lack of Telerif.Security.Data.DefaultSecurityProvider from the API in Sitefinity 4? If not will we be able to in future releases?
Thanks
Sean

Ivan,
In Sitefinity I created a role provider using System.Web.Security.SqlRoleProvider and a membership provider using System.Web.Security.SqlMembershipProvider. I made them have same name and set the DefaultSecurityProvider to that name. The Sitefinity tables are in the same DB as the ASP.NET role and membership tables.
When I tried to login however I get the following exception.
Thanks
Sean
Server Error in '/' Application.
Invalid type specified Telerik.Sitefinity.Security.Data.MembershipDataProvider
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.Exception Details: System.ArgumentException: Invalid type specified Telerik.Sitefinity.Security.Data.MembershipDataProvider
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. |
Stack Trace:
|
You should use a provider that inherits from Telerik.Sitefinity.Security.Data.MembershipDataProvider or Telerik.Sitefinity.Security.Data.OpenAccessMembershipProvider ( the Open Access implementation);
Regards,
Ivan Dimitrov
the Telerik team

>use a provider that inherits from Telerik.Sitefinity.Security.Data.MembershipDataProvider or >Telerik.Sitefinity.Security.Data.OpenAccessMembershipProvider ( the Open Access implementation);
I have seen the posts saying to do so but they didn't work. Invalid type specified Telerik.Sitefinity.Security.Data.MembershipDataProvider]
I think if you could address individually the steps we took in 3.7 to make it work and describe how they differ in this version it would be on great help.
The scenario below which we implemented in 3.7 worked. I broke them out in to individual items. Please could you address each one so I'll know how they differ in this version.
1. In the web.config under RoleManager we added a provider of type System.Web.Security.SqlRoleProvider
How does that differ in this version. We didn't have to write code in 3.7 to do this we just added these settings and the one below and it worked.
Is that still the case?
2. Under Membership we added a provider of type System.Web.Security.SqlMembershipProvider.
You're saying use Telerik.Sitefinity.Security.Data.MembershipDataProvider instead here but on trying that there is an exception. Could you list the steps in more detail in Sitefinity maybe to do this please as there isn't documentation like there was in 3.7.
3. In 3.7 both providers the were given the same name and both providers the were set as the default providers under roleManager and membership in the web.config. Again how does this differ in 4?
5. Under security a provider of type Telerik.Security.Data.DefaultSecurityProvider was added. It's membership and roleProvider attributes were set to the provider names mentioned above and the connectionstringName was set to the db connectionstring where Sitefinity was installed.
This seems to be gone in 4 so what is needed to be done instead?
We only added these settings/steps in 3.7 to successfully integrate and didn't need to write code. Has that changed?
We want to avail of System.Web.Security.SqlRoleProvider and System.Web.Security.SqlMembershipProvider.
Thank
Sean
I am not sure how inheriting from Telerik.Sitefinity.Security.Data.MembershipDataProvider does not work since I have a custom provider that works just perfectly. Also this is an abstract class which is used by the OpenAccess implementation which means that if there is a problem with the MembershipDataProvider, then the entire implementation of OpenAccessMembershipProvider would be broken.
You have to use Sitefinity >> Administration >> Settings >> Advanced >> Security section to register the providers. The main web.config settings are not used in this case.
From this section you can register your custom membership and role providers and add parameters to them like "requiresUniqueEmail"
Kind regards,
Ivan Dimitrov
the Telerik team

Hey Ivan,
Thanks. So it sound like we need to write our own custom providers that inherit from Telerik.Sitefinity.Security.Data.OpenAccessMembershipProvider
and register that.
If you see my posts on 3.7 we didn't need to extended Telerik classes in 3.7. We were able in the config file to add providers that talked directly
to the asp.net role and membership providers (System.Web.Security.SqlMembershipProvider and System.Web.Security.SqlRoleProvider).
We didn't need to implement our own custom providers.
I am trying to add a role provider in 4 RC that uses System.Web.Security.SqlRoleProvider and a membership provider that used
System.Web.Security.SqlMembershipProvider and then register them as the defaults. Sound like this can't be done right?
If we have to do it the other way we will. I've seen other posts on doing it but it'd be nice if we can just do as we did in 3.7
and just add settings to avail of System.Web.Security.SqlMembershipProvider and System.Web.Security.SqlRoleProvider without having to
implement our own classes and registering those.
Again we don't need to implement any custom functionality we just want to use .NET's SqlRoleProvider and SqlMembershipProvider existing functionality.
We succeeded in doing that in 3.7. Is that no longer available? Can that be in done in 4 RC without needing to extend.
Thanks for you help
Sean
I know how Sitefinity 3.x works and yes there you can use directly the ASP.NET Memebrship and Role provider. Sitefinity 4.0 uses its own custom object Telerik.Sitefinity.Security.Model.User and the authentication model is more complex than this one we used in Sitefinity 3.x.
We have a basic implementations for ASP.NET Membershiop, Role and Profile providers which "transfer" your users to Sitefinity's users. Unfortunately, this implementation is not completed and you cannot use it, this is why you need a custom provider as suggested several times here and in other posts in the forum.
Best wishes,
Ivan Dimitrov
the Telerik team
