Skip to content

NicholasAStuart/password-less-login

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

Password-less login

Password-less login into Salesforce Communities

Overview

This project provides an example of password-less login into Salesforce Communities to enable your customers and partners to login using a OTP that is sent to them via SMS or Email.

Instructions

  1. Integrate a 3rd party SMS delivery service such as Twilio or TeleSign

    Install the Twilio's unmanged package for Salesforce from the "Twilio Helper Library for Salesforce": https://www.twilio.com/docs/libraries/salesforce

  2. Generate private and public key

    The private key is required to sign the JSON Web Token (JWT) requests. The certificate (public key) is required to verify the JSON Web Signature (JWS) and perform the API-based authentication.

    • Go to Setup > Security Controls > Certificate and Key Management and generate a self-signed certificate.
    • Download the certificate to you desktop
  3. Create a connected app

    Create a connected app to handle the OAuth JWT bearer flow

  4. Create a Remote Site Setting

    To allow Communities to make outbound HTTP calls to itself there's a need to whitelist the Community URL.

    • Go to Security > Security Controls and create a new Remote Site Setting with your Community URL
  5. Create the Passwordless VF page

  6. Create the LoginController apex class

    Replace the following:

    • TWILIO_ACCOUNT_SID - The Twilio Account SID

    • TWILIO_AUTH_TOKEN - The Twilio Auth Token

    • TWILIO_PHONE_NUMBER - The phone number that initiated the OTP message. This should be one of your Twilio phone numbers.

    • CONNECTED_APP_CLIENT_ID - The connected app client id

  7. In Communities, under Administration > Login & Registration, choose the Passwordless visualforce page as the login page.

About

Password-less Login using SMS and Email authentication

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published