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
Boman@imtBoman@imt 

Site to login to Customer Portal, but unable to mask URL once logged in.

I have Sites enabled to serve as the login for our Customer Portal, and have used CNAME to re-direct traffic from
http://<customdomain>.com to the Site, where the customer then logs in using their credentials. At the site level I have the "Custom Address" field configured to <customdomain>.com.

 

All works great, EXCEPT, once the customer logs in they, unfortunately see the https URL with "...force.com" in it e.g. https://na1.salesforce.com/a02/o This is not good, since I would like to mask the fact from the customer that they are in fact running on a SFDC instance!

Would really appreciate any expert help and precise guidance on how to overcome this. Do I need to roll my own URLRewriter class or what?

 

Thanks.


--Boman.
Ryan-GuestRyan-Guest

How do you log users in? Can you post the code?

Boman@imtBoman@imt

Simple. Modified SiteLoginController to do:

 

 

global pageReference login() {
          String startUrl = 'https://na1.salesforce.com/secur/login_portal.jsp?orgId=<myOrgId>&portalId=<myCPId>'; // Prod
          startUrl += '&un=' + username;
          startUrl += '&pw='+ password;       
          PageReference portalPage = new PageReference(startUrl);
          portalPage.setRedirect(true);
          PageReference p = Site.login(username, password, startUrl);
          if (p == null) {
                return Site.login(username, password, null);
          } else {
                return portalPage;
          }
 }

 

 

Ryan-GuestRyan-Guest

Don't set your startUrl to na1.salesforce.com. 

 

Try this:

 

 

          String startUrl = '/home/home.jsp'; // Prod
          PageReference portalPage = new PageReference(startUrl);
          PageReference p = Site.login(username, password, startUrl);
          if (p == null) {
                return Site.login(username, password, null);
          } else {
                return portalPage;
          }
 }
Boman@imtBoman@imt

Get a "Page Not Found" on attempting login.

 

Where does home.jsp come from, and how is that mapped into the Customer Portal pages?

Force2b_MikeForce2b_Mike

I had a similar issue with my clients portals. Posted here, to the DF Chatter Org and even tried opening a case with Salesforce support. Support rejected the case twice saying that they do not support developer issues and have no responses anywhere else. In the end I had to just redirect them to the na3 instance. I'm not sure if this is a bug or a change to how they're handling portal, but either way I can't get anyone to acknowledge that a problem exists. Though, if you browse this board we're not the only ones posting this issue.

 

http://boards.developerforce.com/t5/Force-com-Sites/Secure-Portal-Login/m-p/405127

Ryan-GuestRyan-Guest

if you're getting page not found it means the page doesn't exist.

 

 

Are you going to /home/home.jsp?

 

That's the main entrypoint for salesforce.com

Force2b_MikeForce2b_Mike

Ryan,

 

I had received this error at one point as well. The error goes away if the Home Tab is enabled for the Site. That doesn't solve the larger issue though. You get the Home Tab without the error, but none of the Portal tabs or portal functionality shows up.

 

Best Regards,

 

Mike

Boman@imtBoman@imt

Ryan, I think you are mis-understanding my issue!

 

All the functionality works perfectly, and everything I'd like Customer Portal users to access is there. But, what I want is to MASK the <...force.com> URL i.e. it should not show up with a force.com domain in the browser's URL field!

 

I've got the URL to the Site redirected using CNAME (so no force.com shows up there), but once the CP user logs in, the URL changes to https:// and unfortunately exposes the force.com domain.

 

So, my question is: what requires to be done in order that a CP user *NEVER* gets to see force.com anywhere in any URL when they are logged into the portal? Thanks.

Benjamin KesnerBenjamin Kesner
We are having this exact problem.  Any one have any ideas?