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
Marty Y. ChangMarty Y. Chang 

secure authentication for Salesforce Site, logging into a Customer Portal

I'm trying to setup a Salesforce Site that will enable a user to create new Customer Portal user accounts and to login using those accounts.  My question is:  During registration and login, how can I ensure that passwords are not sent across the Internet in plain text?

Best Answer chosen by Admin (Salesforce Developers) 
Shashikant SharmaShashikant Sharma

use this

 

<apex:inputSecret id="password" value="{!password}"/>

 this will solve your issue

 

Whenever site is created on any org some defualt page , class and component are also come with it.

See Site Login component for your help which is like

<apex:component controller="SiteLoginController" id="loginComponent">
  <apex:form id="loginForm" forceSSL="true">
    <apex:outputPanel layout="block">
      <apex:pageMessages id="error"/>
      <apex:panelGrid columns="2" style="margin-top:1em;">
        <apex:outputLabel value="{!$Label.site.username}" for="username"/>
        <apex:inputText id="username" value="{!username}"/>
        <apex:outputLabel value="{!$Label.site.password}" for="password"/>
        <apex:inputSecret id="password" value="{!password}"/>
        <apex:outputText value=""/>
        <apex:commandButton action="{!login}" value="{!$Label.site.login_button}" id="loginButton"/>
        <apex:outputText value=""/>
        <apex:outputText value=""/>
        <apex:outputText value=""/>
        <apex:panelGroup id="theLinks">
          <apex:outputLink value="{!$Page.ForgotPassword}"> {!$Label.site.forgot_your_password_q}</apex:outputLink>
          <apex:outputText value=" | " rendered="{!$Site.RegistrationEnabled}" />
          <apex:outputLink value="{!$Page.SiteRegister}" rendered="{!$Site.RegistrationEnabled}">{!$Label.site.new_user_q}</apex:outputLink>
        </apex:panelGroup>
      </apex:panelGrid> 
    </apex:outputPanel>
  </apex:form>
</apex:component>

 You can see this SiteLogin component in your org as well.

All Answers

Shashikant SharmaShashikant Sharma

use this

 

<apex:inputSecret id="password" value="{!password}"/>

 this will solve your issue

 

Whenever site is created on any org some defualt page , class and component are also come with it.

See Site Login component for your help which is like

<apex:component controller="SiteLoginController" id="loginComponent">
  <apex:form id="loginForm" forceSSL="true">
    <apex:outputPanel layout="block">
      <apex:pageMessages id="error"/>
      <apex:panelGrid columns="2" style="margin-top:1em;">
        <apex:outputLabel value="{!$Label.site.username}" for="username"/>
        <apex:inputText id="username" value="{!username}"/>
        <apex:outputLabel value="{!$Label.site.password}" for="password"/>
        <apex:inputSecret id="password" value="{!password}"/>
        <apex:outputText value=""/>
        <apex:commandButton action="{!login}" value="{!$Label.site.login_button}" id="loginButton"/>
        <apex:outputText value=""/>
        <apex:outputText value=""/>
        <apex:outputText value=""/>
        <apex:panelGroup id="theLinks">
          <apex:outputLink value="{!$Page.ForgotPassword}"> {!$Label.site.forgot_your_password_q}</apex:outputLink>
          <apex:outputText value=" | " rendered="{!$Site.RegistrationEnabled}" />
          <apex:outputLink value="{!$Page.SiteRegister}" rendered="{!$Site.RegistrationEnabled}">{!$Label.site.new_user_q}</apex:outputLink>
        </apex:panelGroup>
      </apex:panelGrid> 
    </apex:outputPanel>
  </apex:form>
</apex:component>

 You can see this SiteLogin component in your org as well.

This was selected as the best answer
Marty Y. ChangMarty Y. Chang

Thanks, Shashikant.  I think the piece I was looking for is the forceSSL attribute you showed in the component code.

newto_salesforcenewto_salesforce

Hello Shashikant,

 

I request you to please help me in finding a solution.

 

1. I have created a New site.

2. I have assigned the Active Site Home Page as SiteLogin page.

3. I have created a couple of new users by using "Manage User" options.

4. When I trying to open my new site in browser , Logging page is coming.

5. When I am trying to give the user id and password (created from Manage User options). I am getting and error as mentioned below

 Error:Your login attempt has failed. Make sure the username and password are correct.

 

I am not sure where I am doing wrong.

 

I really appreciate if you can help me in resolving the problem.

 

If required I am ready to share the site details also.

 

Regards

Prashanth