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
mroarkmroark 

Is it possible to setup a Site to authenticate both Customer Portal and Partner Portal users?

My use case is this:

 

I have a VisualForce page which will redirect users to a third party application.  This page uses the vendor's pass through authentication to automatically log users into the third party application.  I would like to make this VisualForce page available to both my Customer Portal and Partner portal users (in fact, available for all authenticated SalesForce users).

 

I would also like to find out what type of user they are authenticated as, as each type of user may have different permissions in the third party application.  I can then use this information to appropriately log the users into the third party application.

 

Reading through the available literature, it appears that I can make a Site accessible only for either Customer or Partner Portal users.  Is this accurate, or am I misreading the documents?

 

joshbirkjoshbirk

In poking around my dev org, it looks like the dropdown for turning on portal for Sites is indeed one or the other (or neither).  Course, you can make the same VF page available to different profiles, including both portal users ... 

 

Are they already authenticated by the time they'd reach this page, or is the missing going from Sites, to authentication, to the page you're referring to?  There is however a login method in Apex with the Sites class that, I believe, is user/portal agnostic.  After they logged in, you'd have to inspect their user object to determine what kind of user they are.

mroarkmroark

joshbirk wrote:

In poking around my dev org, it looks like the dropdown for turning on portal for Sites is indeed one or the other (or neither).  Course, you can make the same VF page available to different profiles, including both portal users ... 

 

Are they already authenticated by the time they'd reach this page, or is the missing going from Sites, to authentication, to the page you're referring to?  There is however a login method in Apex with the Sites class that, I believe, is user/portal agnostic.  After they logged in, you'd have to inspect their user object to determine what kind of user they are.


I would like the end users (Customer Portal, Partner Portal, and regular SalesForce users) to go to a single Sites URL.  At this URL, they will be prompted to authenticate.  After authenticating, I would display the page.

 

I had looked at the Login method on the Sites object.  This method seems to be tied to the specific portal to which you tie the Site, which would only allow authentication for users assigned to the specific Portal which you select.

 

I tested using the default 'SiteLogin' page (which uses this method) with a Customer Portal user for the Portal assigned to the Site and a regular SalesForce user.  It worked with the Customer Portal user, but I was not able to authenticate with a regular SalesForce user account.  I did not test with a Partner Portal user, so I will try this next. 

 

If I can authenticate both Customer Portal and Partner Portal users on a single login page, I will be 85% of the way to what I need.

mroarkmroark

After testing with a Customer Portal and Partner Portal login, I find I can only login with the credentials for the Portal to which the Site is tied.

 

I guess I will have to put a Site in front of the login pages which will look up the appropriate credentials for the user and direct them to the appropriate site.