Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > Form Authentication View modes: 
User avatar
Member
Member
Yash - 3/6/2013 8:59:11 AM
   
Form Authentication
I have created custom login page (.ascx - for user control webpart) to login user based on the the ldap authentication mode and adding that user in the cms user list. I have also created user control page where user can login and redirected to the edit page where they can edit the form. I am wondering how can I make edit page restricted so if you type the edit page url you cann't access it directly and redirect you to the login page?

Thanks,

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 3/6/2013 11:13:42 AM
   
RE:Form Authentication
In the Page Properties, go to the Security tab (on the left) and in the Access area, select Yes to Requires Authentication and click Ok. Also make sure you add Users and/or Roles to the above Permissions area. My guess is you can add Not authenticated users and deny them Full control. Then add Authenticated users and grant them Full control

User avatar
Member
Member
Yash - 3/6/2013 11:31:05 AM
   
RE:Form Authentication
Hello,

Okay, that might work. I have enabled the authentication to 'Yes' and also granted Users and Roles to Allow rights. I have also added 'Public Anonymous User(public)' to Deny 'Full Control'.

Apart from this I was wondering if I can add code on the .ascx page to restrict user from directly accessing that page!

Any suggestion?

Thanks,

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 3/6/2013 5:02:39 PM
   
RE:Form Authentication
Hi,

If the page/document is set and has the security set, than the user without permissions will see access denied page. If you want to do it in the code - you will need to check the current request - the user who is doing the request and do the check on your own - e.g. using IsAuthorizedPerResouce method.

Best regards,
Juraj Ondrus