More in this section

Forums / General Discussions / Samples and SDK for SF4

Samples and SDK for SF4

2 posts, 1 answered
  1. Vik
    Vik avatar
    2 posts
    Registered:
    17 Aug 2010
    20 Jan 2011
    Link to this post
    I have project with custom membership provider.
    Can you prepare some samples for custom membership/role providers for SF4 and add them to starter kit?
    For example: separate filestorage for users and roles (users.txt roles.txt)
    Now we have problems with MembershipProvider and MembershipDataProvider:

    UI: project contains simple single page and standart loging widget from SF4

    file: web.config
    <membership defaultProvider="Default">
    <providers>
    <clear/>
    <add name="Default" type="Telerik.Sitefinity.Security.Data.SitefinityMembershipProvider, Telerik.Sitefinity"/>
    <add name="Dummy" type="XXX.Security.DummyMembershipProviderSF4, XXX.Security"/>
    </providers>
    </membership>
    file: SecurityConfig.config
    <
    membershipProviders>
    <
    add description="Dummy membership provider" resourceClassId="" type="XXX.Security.DummyMembershipProviderSf4" type:type="System.RuntimeType, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" enabled="True" name="Dummy" />
    </
    membershipProviders>

    Code:
    1. public class DummyMembershipProvider:System.Web.Security.MembershipProvider
    Result: class not working

    2. public class DummyMembershipProviderSf4: Telerik.Sitefinity.Security.Data.MembershipDataProvider
    Result: class not working. it is possble my mistake

    Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

    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.
       Telerik.Sitefinity.Data.ManagerBase`1..ctor(String providerName, String transactionName) +131
       Telerik.Sitefinity.Security.UserManager..ctor(String providerName, String transactionName) +8
    
    
    [TargetInvocationException: Exception has been thrown by the target of an invocation.]
       System.RuntimeMethodHandle._InvokeConstructor(IRuntimeMethodInfo method, Object[] args, SignatureStruct& signature, RuntimeType declaringType) +0
       System.RuntimeMethodHandle.InvokeConstructor(IRuntimeMethodInfo method, Object[] args, SignatureStruct signature, RuntimeType declaringType) +15
       System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +281
       Telerik.Sitefinity.Data.ManagerBase`1.GetManager(String providerName, String transactionName) +614
       Telerik.Sitefinity.Security.SecurityManager.AuthenticateUser(String membershipProviderName, String userName, String password, Boolean persistent, User& user) +26
       Telerik.Sitefinity.Security.Web.UI.LoginForm.LoginForm_Authenticate(Object sender, AuthenticateEventArgs e) +131
    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1
    Telerik.Sitefinity.dll Version:4.0.1098.0
    Thank you, for any advice
  2. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    25 Jan 2011
    Link to this post
    Hi Vik,

    Could you please check this forum post - http://www.sitefinity.com/devnet/forums/sitefinity-4-x/bugs-issues/object-reference-not-set-to-an-instance-of-an-object.aspx.
    I believe that this is the problem.

    Kind regards,
    Georgi
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
    Answered
2 posts, 1 answered