MFA Using Salesforce Lightning Flow & Google Email?

on

|

views

and

comments

Table of Contents

Introduction

Multifactor authentication (MFA) adds a layer of protection to the sign-in process. When accessing accounts or apps, users provide additional identity verification, such as scanning a fingerprint or entering a code received by phone or email.

Different ways to achieve MFA

You can implement MFA using various devices like RSA Toke, Any Authenticator application like Google Authenticator, Microsoft Authenticator, Salesforce Authenticator & etc.

Note: – Image copyright to microsoft.com

Steps to implement

  1. Create an Email Template
  2. Create an Email Alert
  3. Create a Screen Flow
  4. Create Login Flow
  5. Test the flow

Setup Email Template

To create the Email template follow the below steps

  1. Click on App launcher ( 9 dots on the left top) & Search for Email Template
  2. Click on New Email Template
  3. For Email Template Name You can give it something like “Your OTP to verify your Identity”
  4. For Related to Select OTP object
  5. Provide Subject like “Your OTP to verify your Identity”
  6. Click Save to Save your Template

Now Click on Edit and Use below content for HTML value

You recently logged in to Salesforce from a browser or app that we need to validate using two-step verification.

Browser: {{{OTP__c.Browser__c}}}
Operating System: {{{OTP__c.OperatingSystem__c}}}
Username: {{{OTP__c.Username__c}}}

To ensure your account’s security, we need to verify your identity. Enter the following code where prompted by auth system

Verification Code: {{{OTP__c.OTP__c}}}

If you didn’t recently log in to Salesforce, or you don’t recognize this browser or operating system, contact your Salesforce administrator.

Create Email Alert

As we have set up the email template, the time is to set up the email alert and this email alert we will use in the flow to send the email to Users when they try to log in.

  1. Navigate to Setup and Search for Email Alert.
  2. Click on New Email Alert
  3. Provide your description
  4. For Object – Select OTP
  5. For Email Template Select the Lightning Email Template you have created in the previous Step
  6. For Recipient Type Select Related User from the Dropdown and then Select “Related User: User”
  7. Save the Email Alert

Develop flow

As we have discussed that the Login Flows is nothing those are Screen flow. So in this demo, we will create a Screen Flow

There is some text content that I have used. So Please find the content below and watch the video for full setup and development

Useful content for flow

Content for Verify Screen

Enter the code sent to you by email.

To ensure your account’s security, we need to verify your identity. Enter the following code where prompted by authy system.

We have sent the code to the email associated with this username: “Use Your Correct Expression here to populate the UserName”

Content for Warning Message

You have made {!invalidAttempt} Invalid attempts. If you exceed 3 attempts your user will be locked!

Content for Logout Screen

You have exceeded the Maximum no of Limits to login. Please contact your system admin for help!

Content for Invalid Login

The OTP that you have entered is not valid!. Please try again or contact your Salesforce Admin!

Final Flow

Email

Complete video

Resources

Amit Singh
Amit Singhhttps://www.pantherschools.com/
Amit Singh aka @sfdcpanther/pantherschools, a Salesforce Technical Architect, Consultant with over 8+ years of experience in Salesforce technology. 21x Certified. Blogger, Speaker, and Instructor. DevSecOps Champion
Share this

Leave a review

Excellent

SUBSCRIBE-US

Book a 1:1 Call

Must-read

How to start your AI Journey?

Table of Contents Introduction Are you tired of the same old world? Do you dream of painting landscapes with your code, composing symphonies with data, or...

The Secret Weapon: Prompt Engineering: 🪄

Table of Contents Introduction Crafting the perfect prompt is like whispering secret instructions to your AI muse. But there's no one-size-fits-all approach! Exploring different types of...

How to Singup for your own Production org?

Let's see how we can have our salesforce enterprise Salesforce Org for a 30-day Trial and use it as a Production environment. With the...

Recent articles

More like this

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Table of Contents Introduction Multifactor authentication (MFA) adds a layer of protection to the sign-in process. When accessing accounts or apps, users provide additional identity verification, such as scanning a fingerprint or entering a code received by phone or email. Different ways to achieve MFA You can implement...MFA Using Salesforce Lightning Flow & Google Email?
5/5

Stuck in coding limbo?

Our courses unlock your tech potential