Custom Login control

Posted by Community Admin on 04-Aug-2018 14:27

Custom Login control

All Replies

Posted by Community Admin on 07-Mar-2013 00:00

Looking for some assitance on a custom login control, which will provide redirection to a url based on a custom property, for now I have just set this to google to test the control,

I have created a class inheriting from the LoginWidget

    public class Login : LoginWidget

    
        protected override void InitializeControls(Telerik.Sitefinity.Web.UI.GenericContainer container)
        
            base.InitializeControls(container);
            this.DestinationPageUrl = "www.google.com";
        
    

I have then registered this class via the admin->settings->advanced->toolboxes->pagecontrols->sections, see attached screenshot

I have then created a dummy page to test the control but when I preview the control I get the below error, any help would be greatly appreciated.

Server Error in '/' Application.Unable to cast object of type 'System.Web.Compilation.BuildResultCompiledAssembly' to type 'System.Web.Util.IWebObjectFactory'.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.InvalidCastException: Unable to cast object of type 'System.Web.Compilation.BuildResultCompiledAssembly' to type 'System.Web.Util.IWebObjectFactory'.

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: 

[InvalidCastException: Unable to cast object of type 'System.Web.Compilation.BuildResultCompiledAssembly' to type 'System.Web.Util.IWebObjectFactory'.]
System.Web.UI.TemplateControl.LoadControl(VirtualPath virtualPath) +179
Telerik.Sitefinity.Modules.Pages.ControlBuilder.CreateControl(Page page) +122
Telerik.Sitefinity.Modules.Pages.PageHelperImplementation.CreateChildControls(IList`1 controls, Page page, Boolean ignoreCultures) +591
Telerik.Sitefinity.Modules.Pages.DraftProxyBase.CreateChildControls(Page page) +654
Telerik.Sitefinity.Modules.Pages.PageDraftProxy.CreateChildControls(Page page) +31
Telerik.Sitefinity.Web.PageEditorRouteHandler.ApplyLayoutsAndControls(Page page, RequestContext requestContext) +415
System.Web.UI.Control.LoadRecursive() +71
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3064

Posted by Community Admin on 12-Mar-2013 00:00

Hi,

We have not encountered the problem before. In version 5.4 you can easily authenticate the user with SecurityManager.AuthenticateUser(); and one of the available overload. This will enable you to create an entirely custom Login Control to best fit your scenario.

Kind regards,
Atanas Valchev
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 12-Mar-2013 00:00

Can you post an example I have tried various attempts at a custom login control with no luck.

Thanks

Posted by Community Admin on 14-Mar-2013 00:00

Hi,

 Here is a simple custom login control example.

Kind regards,
Atanas Valchev
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 28-May-2013 00:00

Thanks al, good stuff!!

In my case, I'm try to extend the default login and add two-factor authentication for all member to login the e-commerce portal, could anyone provide the advice here? 

Many Thanks!!! 

Rgds,

PC

This thread is closed