---
schema_version: "1"
id: 3f909c77bfe2ae27167cb3a62cc8cc0330b53ab0f0dbee891fe0f9107d7ead12
title: Create a Custom Login Discovery Page
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/experience/264-0-0/external_identity_passwordless_login_in_apex.md
canonical_url: https://help.salesforce.com/s/articleView?id=experience.external_identity_passwordless_login_in_apex.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 058fbae98afd282c25cf6589ae63f69bbf0a6ebe07a3c258cb83d7fa9b923c37
description: To set up passwordless login with an email address or phone number, create a custom Login Discovery page. With this configuration, your users can self-register and log in with an email address or phone number. Set up your page in Experience Workspaces, and customize your login process with Apex.
products:
  - Experiences
release: "264"
---
# Create a Custom Login Discovery Page

To set up passwordless login with an email address or phone number, create a custom Login Discovery page. With this configuration, your users can self-register and log in with an email address or phone number. Set up your page in Experience Workspaces, and customize your login process with Apex.

When you create your Login Discovery page in Experience Workspaces, Salesforce generates a LoginDiscovery handler. You can customize the LoginDiscovery handler later.

1. From Setup, in the Quick Find box, enter All Sites, and select **All Sites**.
2. Next to your site name, click **Workspaces**.
3. In the Workspaces page, select **Administration**, and then select **Login & Registration**.
4. Under Login Page Setup, for Login Page Type, select **Login Discovery Page**.
    
    ![Login Page Setup](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-experience-communities-264-0-0-production-enus/bf7df212-91a1-4fa3-a007-4d6f3e3b470b/communities/images/xid_login_discovery_empty_handler.png)
5. (Optional) For Login Prompt, enter the text that you want to appear as the prompt on your login page.
    
    For example, enter Email Address or Phone Number. You can localize the login prompt with a custom label. Use the `$Label` global variable, for example, `$Label.loginPrompt`.
6. For Login Discovery Handler, leave the field blank and click **Create a Login Discovery Handler**. Salesforce auto-generates the Apex handler on save. You modify the code later.
7. For Execute Login As, select a Salesforce admin with the Manage Users permission to run the handler.
    
    Execute Login As provides the context in which the Login Discovery handler runs. By assigning a user to the handler, operations performed by the handler are easily traced back to the login process. In production, you typically create a system user for the Execute Login As user.
8. If **Allow employees to log in directly to the site** is selected, deselect it.
    
    The Login Discovery Page doesn’t support org employees logging in to the site directly. However, you can customize the handler to redirect users to an IdP. For employees, you can set up Login Discovery with My Domain. From your My Domain Authentication Configuration settings, set the login page type to Discovery.
9. Save your settings.
    
    Salesforce generates a default login discovery handler and populates the Login Discovery Handler field with its name. This handler accepts an email address or phone number from the login page and emails or texts a verification code to the user. If the user’s email or phone number isn’t verified, the user is prompted for a password.
    
    To customize the welcome email that new users receive when they sign up with their email address, see [Customize the Passwordless Registration Welcome Email Template](https://help.salesforce.com/s/articleView?id=experience.networks_otp_welcome_email.htm&language=en_US).