Modifying LoginWidget

Posted by Community Admin on 04-Aug-2018 18:56

Modifying LoginWidget

All Replies

Posted by Community Admin on 27-Aug-2013 00:00

I am new to Sitefinity. We are in the process of migrating one of our sites to Sitefinity. In doing this, I would need to validate users and allow them to view couple of subpages after successful authorization. We do not want add these (> 2,000 users) to Sitefinity. We already have a user database and would like to use.

I am thinking of extending LoginWidget (cannot use LoginControl).

1.       Is there any sample or documentation that will help me extend LoginWidget? I found couple posts related to this but did not find anything that showed me how to trap Login button click event to validate users.

2.       I believe, DestinationPageUrl property will allow me to redirect to subpages? Is this correct assumption?

3.       What would be the best way to only allow authenticated users to see the subpages? Do I have to create a dummy Sitefinity user and then assign that user to access subpages?

Thanks for your help!

Posted by Community Admin on 30-Aug-2013 00:00

Hello,

Thank you for contacting us.

In this situation, you can do a couple of things:

1) Use the ASP.net membership provider as described here:Using the ASP.NET Sql Membership Provider in Sitefinity 

2)Importing the users to Sitefinity. Several thousand users are a relatively small amount and will give you the ability to maintain the users in one place.

3)Creating an entirely custom membership provider.

For the view permissions for pages, the authenticated user will need the appropriate permissions to view the page. By default Pages have view permissions set to Everyone. For your secured pages you will need to change these view permissions to a specific role or users:Set up permissions for content authoring

I think it would be best if you create an entirely custom login widget, as this will give you full control and flexibility over the redirect action after login and so on. With the API, authenticating the user is 1 line of code using the SecurityManager:

SecurityManager.AuthenticateUser("Default", username.Text, password.Text, rememberme.Checked);
You just pass the provider, username, password and if the remember me is checked. After that you will have full control.


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

This thread is closed