Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

I am trying to have my Customer Portal use a custom URL instead of the Salesforce one. The Salesforce one right now looks like this:
https://cs13.salesforce.com/secur/login_portal.jsp?orgId=orgId&portalId=portalId

I followed the instructions here to set everything up: http://wiki.developerforce.com/page/Authenticating_Users_on_Force.com_Sites

My SiteLoginController looks like this:

global with sharing class SiteLoginController {
    global String username {get; set;}
    global String password {get; set;}

    global PageReference login() {
        String startUrl = 'https://cs13.salesforce.com/secur/login_portal.jsp?orgId=<orgId>&portalId=<portalId>';
        return Site.login(username, password, startUrl);
    }

    global SiteLoginController () {}

    @IsTest(SeeAllData=true) global static void testSiteLoginController () {
        // Instantiate a new controller with all parameters in the page
        SiteLoginController controller = new SiteLoginController ();
        controller.username = 'test@salesforce.com';
        controller.password = '123456'; 

        System.assertEquals(controller.login(),null);                           
    }    
}

However, when I go to my login page and try and login, nothing happens. How do I get this to work?

Additionally, instead of my portal being at http://mycompany.test.cs13.force.com/apex/SiteLogin, I want it to be something like http://suport.mycompany.com. How would I do that?

share|improve this question
2  
Be sure that you understand that Custom web addresses do NOT work with SSL. You cannot have https://support.mycompany.com. If your users are logging in using the portal for authentication they will get redirected to the secure.force.com domain since that's the domain that SF has SSL certs for. –  Peter Knolle Oct 12 '12 at 23:39
add comment

3 Answers 3

up vote 2 down vote accepted

Starturl should not be the full URL. /apex/pagename is what you need. For the default portal home page, you can use /home/home.jsp

share|improve this answer
add comment

You can use a custom web address. See http://www.salesforce.com/docs/developer/cookbook/Content/sites_using_custom_domain.htm for more info on setting that up.

Also, it is important to know that in your example above, you are using a sandbox instance (cs13). Custom web addresses are not supported on these instances. If you want to use a custom web address, you will need to use a production instance.

share|improve this answer
    
Is this still correct as at December 2013? –  Steven Herod Dec 2 '13 at 4:51
    
yes, still not supported –  Ryan Guest Dec 2 '13 at 4:52
add comment
public PageReference login() {
String startUrl =    System.currentPageReference().getParameters().get('startURL');
return Site.login(username, password, startUrl);
}

Have a look at this section carefully and compare with your code please

Another source code and its working .You may like to try that

global PageReference login() {

  //static org-id and portal id
  String strOrgID = '';
  String strPortalID = '';
  String strURL = '';
  //start url of the page
  String startUrl = strUrl + '/secur/login_portal.jsp?orgId=' + strOrgID + '&portalId=' + strPortalID;

startUrl += '&un=' + username;
    startUrl += '&pw='+ password;

    //set reference and attempt login
    PageReference portalPage = new PageReference(startUrl);
    portalPage.setRedirect(true);
    PageReference p = Site.login(username, password, startUrl);

    //if p==null, no login
    if (p == null) {
          return Site.login(username, password, null);
    } else {
          return portalPage;
    }
}

This blog might help : http://threeheadsonapike.wordpress.com/2012/06/07/customized-salesforce-customer-portal/

For your second question have a look at this website

support.activision.com

Now you have company name .All you need to do is purchase the domain name and map in site settings to work

https://ap1.salesforce.com/help/doc/user_ed.jsp?loc=help&target=sites_configuring_sites.htm&section=integrate&instance=AP1&release=178.21.5

Custom Web Address The optional branded custom Web address that you registered with a third-party domain name registrar. The custom Web address acts as an alias to your Force.com address. To enable a custom Web address, create a CNAME record to your Force.com domain with that registrar. If you have not registered this address, you encounter an error. Custom Web addresses aren't supported for sandbox or Developer Edition organizations.Note If you choose to create a branded top-level domain or subdomain through a domain name registrar, the CNAME record that you provide to that registrar must be your Force.com domain name and not the site URL. For example, if you entered mycompany when registering your Force.com domain, the CNAME must be mycompany.force.com, not the full value of the site URL.

You will have a field in site settings to specify Custom web address .Need to put your company URL there.This feature avaialable in Production instance only

share|improve this answer
1  
the above code is incorrect. if you're already calling Site.login why would you pass in login_portal.jsp as the startUrl? –  Ryan Guest Dec 7 '12 at 15:42
    
Please try the code .It works ! –  Mohith Shrivastava Dec 7 '12 at 16:50
1  
It compiles, but if I login with site.login why would I redirect to the Jsp page to login again? –  Ryan Guest Dec 7 '12 at 17:28
    
startURL should be = '/home/home.jsp' or the relative URL of any other tab –  Suman Krishna Saha Mar 8 '13 at 7:13
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.