Implement Timer Under MFA in PowerApps login Screen

Hello Everyone !! Welcome back to our site. Before I start anything about how to Implement Timer Under MFA in PowerApps login Screen. I would request all of you to click on this link. This will provide you a detailed background of MFA (Multi-Factor Authentication) in PowerApps login screen. Before we proceed how we can do this, please check this demo video.

Follow below steps.

1. Write this code on App Run on Start : Set(otpInputMode,”edit”);Set(timerStart,””);Set(loginButton,true)
2. Add a timer control and make the display mode as view.
3. Duration of timer control is 45000. You can adjust this as per your requirement.
4. Start for timer control is variable timerStart.
5. OnTimerEnd formula for timer control is UpdateContext({otpInputMode:”disabled”});UpdateContext({timerStart:false})

Click to view more details on timer control.

Update login button with this below extra piece of code.

If(
!IsBlank(
LookUp(
‘User Details’,
UserName = TextInput1.Text And UserPassword = TextInput1_1.Text
).UserName
),
UpdateContext({timerStart:true})
);If(
!IsBlank(
LookUp(
‘User Details’,
UserName = TextInput1.Text And UserPassword = TextInput1_1.Text
).UserName
),Set(loginButton,false))


Also add below code under On Select of Resend OTP button.
UpdateContext({otpInputMode:”edit”});Reset(Timer1);UpdateContext({timerStart:true})

Update the display mode of OTP input text box is equal to variable otpInputMode.

Performed above steps, then what are you waiting for, test your timer under MFA in PowerApps login screen.

Hope you will like this article. Please share this article and subscribe our site for more power platform related articles.
Cheers !!

Sharing is Caring

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top