---
schema_version: "1"
id: a9113bb1d5261ff0eb23f660fda3f4689a3c2a45653c24f8c13b35afd7fd3083
title: Create a Custom Login Page in Visualforce
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/xcloud/264-0-0/external_identity_custom_login_page_login.md
canonical_url: https://help.salesforce.com/s/articleView?id=xcloud.external_identity_custom_login_page_login.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: caef2971addf9837c458b48774040b3ee666eba20d23b2735c5473d0f60f258d
description: Create your custom login page in Visualforce, and associate it with your site from the Login & Registration page of the Administration workspace. You can also create custom Visualforce pages for password, forgot password, and self-registration. You can add these login pages to your Experience Cloud site regardless of the template you used to create the site.
products:
  - Security
  - Cross Cloud
release: "264"
---
# Create a Custom Login Page in Visualforce

Create your custom login page in Visualforce, and associate it with your site from the Login & Registration page of the Administration workspace. You can also create custom Visualforce pages for password, forgot password, and self-registration. You can add these login pages to your Experience Cloud site regardless of the template you used to create the site.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: Salesforce Classic and Lightning Experience</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>Enterprise</strong>, <strong>Performance</strong>, <strong>Unlimited</strong>, and <strong>Developer</strong> Editions</td></tr></tbody></table>

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small permission">
        <colgroup>
          <col style="width:50%">
          <col style="width:50%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="colgroup" class="slds-cell-wrap" colspan="2" style="text-align:center;vertical-align:top;" id="d27048e72">User Permissions
              Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d27048e72 ">To create and edit Visualforce pages:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d27048e72 ">Customize Application</td>

          </tr>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d27048e72 ">To edit Apex classes:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d27048e72 ">
              <p>Author Apex</p>
              <p>AND</p>
              <p style="margin-bottom:0;">Customize Application</p>
            </td>

          </tr>
        </tbody>
      </table>

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-identity-264-0-0-production-enus/699dab6f-8f1a-4662-b24f-6521d5b747f7/images/icon_note.png)

Note You can select a Visualforce page as your custom login page for Aura sites only. If you used a Visualforce page as your custom login page for an LWR site before Summer ’23, the site can continue to use the Visualforce page. However, if you change the LWR site’s login page to another page type, you can’t go back to using the Visualforce page.

1. [Create a Visualforce page](https://help.salesforce.com/s/articleView?id=platform.pages_creating.htm&type=5&language=en_US). To customize the look of your login page, create a Visualforce page. To determine how the Apex controller gets invoked, include Apex code. For example, when the user clicks the Login button:
    
    `apex:commandButton action="{!login}" value="Sign in" id="login-submit" styleClass="btn btn-lg btn-primary btn-block"/>`
2. To make your page available externally, set up public access.
    1. From Setup, in the Quick Find box, enter All Sites, and then select **All Sites**.
    2. Next to your site name, click **Workspaces**, then click **Administration**.
    3. In the Administration workspace, select **Pages**.
    4. Click **Go to Force.com**.
    5. Click **Public Access Settings**.
    6. Under Enabled Visualforce Page Access, click **Edit**.
    7. Select the Visualforce pages you created, add them to **Enabled Visualforce Pages**, and save your changes.
        
        ![Enable Visualforce pages](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-identity-264-0-0-production-enus/699dab6f-8f1a-4662-b24f-6521d5b747f7/identity/images/xid_custom_login_page_enable_vf.png)
    8. If necessary, enable Apex classes for public access. Under Enabled Apex Class Page Access, click **Edit**, select the classes, and add them to **Enabled Apex Classes**.
3. From your Login & Registration page, replace the site’s default pages with your custom Visualforce pages.
    1. From Experience Workspaces, select **Administration**, and then select **Login & Registration**.
    2. Under Login Page Setup, select **Visualforce Page**, click ![lookup magnifying glass](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-identity-264-0-0-production-enus/699dab6f-8f1a-4662-b24f-6521d5b747f7/resources-global/_corporate/images/lookup.png), and then select your custom Visualforce page from the list. Be sure that your site’s login page and your site’s Reset Password page use different Visualforce pages.
4. View your custom login page from a browser in private (incognito) mode.

- **[Example: Create a Custom Visualforce Login Page from a Github Project](https://help.salesforce.com/s/articleView?id=xcloud.external_identity_custom_login_git_project.htm&release=264.0.0&type=5)**  
    When creating custom code for your login page, it’s often helpful to start out with an existing example for guidance. Salesforce Identity provides a Github custom login page project that you can modify. The project includes custom Visualforce pages and Apex controllers.