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
Krishna PrabhakarKrishna Prabhakar sites using Partner Portal authentication

Hi All,


I am trying to build an authenticated site where i want to use partner portal authentication. For this process i have done below steps:


1. created a partner portal and enabled login.

2. create a profile and assigned it to the partner portal.

3. created a site and in the login settings i have given the login for the partner portal that i have created.

4. in the site home page i have given the site login page and in the login controller i am redirecting to the portal page(login controller provided).


global pageReference login()
String startUrl = '';
startUrl += '?orgId=00DW0000000HjKa&portalId=060W0000000D0Xx&loginType=3';
startUrl += '&startUrl=';
startUrl += '&loginUrl=';
startUrl += '&useSecure=true';
startUrl += '&un=' + username;
startUrl += '&pw='+ password;

PageReference portalPage = new PageReference(startUrl);
PageReference p = Site.login(username, password, startUrl);
if (p == null) return Site.login(username, password, null);
else return portalPage;


But when i click on the site URL in the login page even if i give right credentials it is not redirecting to anywhere but when i follow the same process using the customer portal i am able to perform successfully. Does Salesforce doesnot provide support for Partner Portal licences for the sites? Did anyone of you implemented this before


Thanks in Advance,



you shouldn't need to include the username and password in the startUrl. Try using something like '/home/home.jsp'