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
sw6sw6 

Customizing communities login page

    Hi, could someone walk me through the process of customizing the salesforce communities login page? I have read the communities implementation guide but was a bit confused on certain aspects.

 

http://na15.salesforce.com/help/doc/en/salesforce_communities_implementation.pdf

 

1. Are we supposed to simply drop the visualforce markup into the salesforce generated communitiesLogin  visualforce page?

 

2. There is also a SF generated customerLoginController that is provided when you create your community. The implementation guide says you should add the code below to the controller. Do I just need to add this code without applying any changes to the already provided page reference method? 

 

global PageReference forwardToCustomAuthPage() {
        String startUrl = System.currentPageReference().getParameters().get('startURL');
        return new PageReference(Site.getPrefix() + '/SiteLogin?startURL=' +
        EncodingUtil.urlEncode(startURL, 'UTF-8'));
}

 

Thanks.

Best Answer chosen by Admin (Salesforce Developers) 
Vin25Vin25

I faced the same issue. While I tried to use a custom visual force login page, the page was getting into infinite loop. I  figured out that we need to make sure the visual force page is listed in the Visual force page access settings.

 

Go to Develop->Sites->Click the Site label->Public access settings->Visual force page access->Edit ->add the custom VF page to the list and save.

 

The login page now redirects successfully.




All Answers

Vinita_SFDCVinita_SFDC

Hello,

 

Please refer the below document which explains step by step :

 

https://help.salesforce.com/apex/HTViewHelpDoc?id=networks_customize_login.htm&language=en_US

sw6sw6

Hi Vinita, I am looking for a way to fully customize the login page just like you are able to customize the login page for customer portals. Thanks.

Vinita_SFDCVinita_SFDC

Hello,

 

Make VF login page like:

 

<apex:page id="loginPage" controller="CommunitiesLoginController" action="{!forwardToAuthPage}" title="{!$Label.site.site_login}">
</apex:page>

 

And controller like:

global with sharing class CommunitiesLoginController {

    global CommunitiesLoginController () {}
    
    // Code we will invoke on page load.
    global PageReference forwardToAuthPage() {
        String startUrl = System.currentPageReference().getParameters().get('startURL');
        return Network.forwardToAuthPage(startUrl);
    }
    
    @IsTest(SeeAllData=true)
    global static void testCommunitiesLoginController () {
        CommunitiesLoginController controller = new CommunitiesLoginController ();
        System.assertEquals(controller.forwardToAuthPage(),null);                           
    }    
}

sw6sw6

Hi Vinita,

 

I tried to create the custom visualforce page and do a redirect in the apex CommunityLoginController but that wasn't working for me - the redirect went into some sort of infinite loop. I finally customized the SiteLogin components and SiteTemplates that were created by Salesforce when I set my community up. Atm it's close to where I want it to be.

 

Thanks.

 

Vinita_SFDCVinita_SFDC

Hello,

 

Follow below steps for redirecting community to a vf page:

 

Setup|Build|Communities|Manage Communities|click Force.com site of the community where you eish to setup the URL redirect|Click button 'URL Redirects'|Click edit if there is existing source else create a new one and provide the target URL that will be of your VF page.

 

Refer: http://help.salesforce.com/help/doc/en/sites_redirects.htm

Vin25Vin25

I faced the same issue. While I tried to use a custom visual force login page, the page was getting into infinite loop. I  figured out that we need to make sure the visual force page is listed in the Visual force page access settings.

 

Go to Develop->Sites->Click the Site label->Public access settings->Visual force page access->Edit ->add the custom VF page to the list and save.

 

The login page now redirects successfully.




This was selected as the best answer
sw6sw6

Hi Vin25, thanks for your insight. I will follow your suggestions and give you feedback ASAP.

 

Thanks

sw6sw6

Hey Vin25,

 

Your suggestion did the trick. It was exactly what I wanted. Thanks.

Vin25Vin25

Good to hear that :)

78thdevil78thdevil
Hi Everyone ,

I am facing the same issue . Whenever the customer logins he is getting the standard salesforce login page but not the custom VF page i designed. I tried setting it as Active/Inactive Site homepage , also i added it in the "enable visualforce pages Access" . But still couldnt get through .
Can anyone please help on this issue asap ?? thanks in advance..!!!
FlorSFFlorSF
Hi sw6, could please post the complete solution? 
I'm facing the same issue and neither your modification or the page access settings did the trick.
I've already made the change in the controller and added the page to the site access settings, but still seeing standard /login page