function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sam.arjSam.arj 

Retricting Access to VF page in Sites

In my site login is enable for example if I set IdeasHome as my site's home page the login page is prompted and forces the user to eithe login or sign up.

 

however when I make a Visualforce page the default page guest user can browse it without any authentication!

 

Is there any place where I can set this page as restricted page and force login before this page is viewed?

 

In the "public settings" I have removed the visualforce page asumming either this would force the login requirement or at least give an access denied message

None of the above the page is still being view with no problems!

 

Any iadea?

 

Best Answer chosen by Admin (Salesforce Developers) 
BulentBulent

you use the login page as your site home page and don't enable the pages that you don't want anonymous users to access.

 

site is about anonymous access. For authenticated access you integrate your site with portals or directly use portals.

so you need to only enable the login page for your public site, and then enable all the other pages for the portal profile so that after login users can access to these pages.  

All Answers

BulentBulent

you need to remove the ideasHome page from your site and disable the read permission for the ideas object for our site.

then just use the login page as your home page

 

you need to set our portal profiles in a way that portal will have access tot he ideas object etc.

then in your login class pass the ideas page as a StartURL so that when people login they will be taken to the ideas page.

 

there are several post related to startURL, you should be able to find them via the search on the top right corner of this page. 

 

 

Message Edited by Bulent on 09-18-2009 09:49 AM
Sam.arjSam.arj

Fristly I do not intend to use ideasHome as my site's home page but to use my "Visualforce" page.

 

Secondly what if the user directly browsed the VF page via URL instead of going to home page (login page).

 

 

BulentBulent
if your page is not enabled for the site that can not access to the page.
Sam.arjSam.arj

I CAN SEE THE VF PAGE EVEN THOUGH THE VF PAGE IS NOT ADDED TO THE SITE VISUALFORCE PAGES BECAUSE THE PAGE IS SET AS SITE'S HOME PAGE.

 

THE ISSUE IS:

How do I force the user to login before access the site's home page or any other VF page in the site?

 

Example:

 

http://mysite.force.com/customer/vfpage1

is homepage

 

and 

 

 http://mysite.force.com/customer/vf_another_page 

 

is the second one

 

If a user wants to browse any of these pages, the user should be redirected to LOGIN page, be authenticated and then would be able to access the pages.

 

How can I achieve that?

 

 

BulentBulent

you use the login page as your site home page and don't enable the pages that you don't want anonymous users to access.

 

site is about anonymous access. For authenticated access you integrate your site with portals or directly use portals.

so you need to only enable the login page for your public site, and then enable all the other pages for the portal profile so that after login users can access to these pages.  

This was selected as the best answer