Exception: Invalid type specified Telerik.Sitefinity.Security.Data.MembershipDataProvider - Front- & Back-End Development - Front- & Back-End Development - Progress Community
 Front- & Back-End Development

Exception: Invalid type specified Telerik.Sitefinity.Security.Data.MembershipDataProvider

  • Exception: Invalid type specified Telerik.Sitefinity.Security.Data.MembershipDataProvider
  • Hi,

    I'm testing the "Enterprise Edition" trial version of Sitefinity for using it in my company.

    I will try to explain that I attempting to do. I have a web site behind a Proxy, which is in charge to do the user's authentication. That means that when users type in the sign in page their user and password and they click the sign in button, the request will intercepted by the proxy component that will authenticate the users in another BD, Ldap or whatever system that could do that. Them, the proxy will forward to our website the request with some aditional http headers with information about the user's autentication. When our website gets the request it will need to supply to sitefinity if the user is or not authenticated in order to allow or deny the access to the page.

    These are the steps that I follow:

    1. I have created an httpModule in order to intercept the requests.
    2. I have subscribe to the OnBeginRequest and OnEndRequest events

            public void Init(HttpApplication httpApp)
                httpApp.BeginRequest += new EventHandler(OnBeginRequest);
                httpApp.EndRequest += new EventHandler(OnEndRequest);

    3. I have written the next code in the OnBeginRequestEvent in order to notify to Sitefinity the identity for the user "GONZALO" and MembershiProvider Psso through the SitefinityPrincipal

            public void OnBeginRequest(Object sender, EventArgs e)
                HttpApplication httpApp = (HttpApplication)sender;
                httpApp.Context.Items["beginRequestTime"] = DateTime.Now;
                var msisdn = FindHeaderField(httpApp.Request.Headers, MSISDN_HEADER_NAME);
                httpApp.Context.User = new SitefinityPrincipal(new GenericIdentity(@"Psso\GONZALO"));

    4. I have implemented a provider PssoMembershipProvider that inherits from SitefinityMembershipProvider (I haven't overriden any method)

    6. I have set my httpModule in the web.config file

        <add name="PssoAuthenticateModule" type="HttpModulePsso.PssoAuthenticateModule, HttpModulePsso"/>

    6. I have set my PssoMembershipProvider in the SecurityConfig.config file
                        <add description="Proxy Single SignOn" resourceClassId="SecurityResources" type="HttpModulePsso.PssoMembershipProvider" type:type="System.RuntimeType, mscorlib, Version=, Culture=neutral,                        PublicKeyToken=b77a5c561934e089" enabled="True" name="Psso" />

    Finally it doesn't works and it returns an exception: System.ArgumentException: Invalid type specified Telerik.Sitefinity.Security.Data.MembershipDataProvider

    [ArgumentException: Invalid type specified Telerik.Sitefinity.Security.Data.MembershipDataProvider]
    Telerik.Sitefinity.Data.ManagerBase`1.InstantiateProvider(IDataProviderSettings providerSettings, Type providerType, ExceptionPolicyName policy, ManagerBase`1 manager) +2706
    Telerik.Sitefinity.Data.ManagerBase`1.InstantiateProvider(IDataProviderSettings providerSettings, ExceptionPolicyName policy, ManagerBase`1 manager) +117
    Telerik.Sitefinity.Data.ManagerBase`1.SetProvider(String providerName, String transactionName) +407
    Telerik.Sitefinity.Data.ManagerBase`1.GetManager(String providerName, String transactionName) +316
    Telerik.Sitefinity.Data.ManagerBase`1.GetManager(String providerName) +75
    Telerik.Sitefinity.Security.UserManager.GetManager(String providerName) +36
    Telerik.Sitefinity.Security.SecurityManager.GetUserId(String membershipProviderName, String userName) +46
    Telerik.Sitefinity.Security.SecurityManager.GetUserId(String fullName) +235
    Telerik.Sitefinity.Security.SitefinityPrincipal..ctor(IIdentity identity) +251
    HttpModulePsso.PssoAuthenticateModule.OnBeginRequest(Object sender, EventArgs e) +334
    System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +148
    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

    Could anyone guide me please ? I have forgot to do something in the settings of sitefinity?? I need to develop any other component.

  • Hello Gonzalo,

    Thank you for contacting Telerik Support.

    from the error it seams that the SitefinityIdentity which is being cast from the GenericIdentity you pass to the SitefinityPrincipal constructor is not able to properly get the provider of your user. It tries to instantiate it with the default Siteifnity provider and you get the exception. Can you try instantiating the identity by manually setting the provider name:
    void context_BeginRequest(object sender, EventArgs e)
        HttpApplication httpApp = (HttpApplication)sender;
        httpApp.Context.Items["beginRequestTime"] = DateTime.Now;
        var msisdn = FindHeaderField(httpApp.Request.Headers, MSISDN_HEADER_NAME);
        System.Web.Security.FormsAuthenticationTicket ticket = new System.Web.Security.FormsAuthenticationTicket(@"Psso\GONZALO",false,120);
        SitefinityIdentity identity = new SitefinityIdentity();
        identity.Ticket = ticket;
        identity.Provider = "YourProviderName";
        //the unique guid id of your user
        identity.Id = new Guid("");
        httpApp.Context.User = new SitefinityPrincipal(identity);

    Also note that the Sitefinity 4.1 release will support Windows Authentication and will provide functionality to use NTLM-based authentication in conjunction with users coming from LDAP.

    Radoslav Georgiev
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>