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
UndertowUndertow 

How to login to customer portal using VF login

How do I login to customer portal from a VF login page?

 

I created a login page which uses the default login component, but couldn't find information anywhere how to login straight to customer portal using VF login component.

Best Answer chosen by Admin (Salesforce Developers) 
SurekaSureka

Hi,

 

 You can login into customer Portal from the VF page by following the below steps:

 

1. Identify the Customer Portal Contact.

2. Fetch the User Id of the corresponding Customer Portal Contact.

3. Fetch the Organization Id

3. Substitue the values in the url - /servlet/servlet.su?oid=valoid&suportaluserid=userid&retURL=/conid&targetURL=/home/home.jsp&suportalid=custportalid

 

where valoid - corresponding organization

            Userid -customer portal user

            conid  - corresponding contact Id

            custportalid - Id of the corresponding customer portal where you need to login.

 

Hope this helps.

 

Thanks

Sureka

All Answers

shillyershillyer

Are you trying to use Customer Portal with Sites? There's a great article describing how to set this up.

 

Hope that helps,

Sati

SurekaSureka

Hi,

 

 You can login into customer Portal from the VF page by following the below steps:

 

1. Identify the Customer Portal Contact.

2. Fetch the User Id of the corresponding Customer Portal Contact.

3. Fetch the Organization Id

3. Substitue the values in the url - /servlet/servlet.su?oid=valoid&suportaluserid=userid&retURL=/conid&targetURL=/home/home.jsp&suportalid=custportalid

 

where valoid - corresponding organization

            Userid -customer portal user

            conid  - corresponding contact Id

            custportalid - Id of the corresponding customer portal where you need to login.

 

Hope this helps.

 

Thanks

Sureka

This was selected as the best answer
SurekaSureka

Hi,

 

To elaborate more on the above solution:

 

1. Create a VF page where you can enter Username and Password.

2. Onclick of login buttton, fetch the Username.

3. From the Username fetch the UserId and the ContactId of the corresponding User.

4. Fetch the Organization id and the customer Portal Id.

5. Substitute it in the above mentioned url and re-direct it.

 

Thanks

Sureka

UndertowUndertow

Thank you. That was very helpful.