Skip to main content

8 replies

harshitb6843
Brainy
Jun 28, 2023 6:05 AM UTC

You mean this interface or this method of authenticating?

If authenticating - Then you again have 2 ways. Email and SMS. For email, it is pretty simple, you generate a random 4-digit code, keep it saved in a variable and send it via Send Email smart service. Then when the user enters that code, you just validate that against the value saved in the variable. 

For SMS, you have to use an external API like Twillio.

Known Participant
Jun 28, 2023 10:05 AM UTC

Hi Harshit ,

i have to configure this  of method of authenticating? so if i click on link randon 4 digit OTP will generate.

and how can i  generate a random 4-digit code via email and how to show in interface.

harshitb6843
Brainy
Jun 28, 2023 12:01 PM UTC

You can generate the code using rand() function. 

stefanhelzle0001
Brainy
Jun 28, 2023 7:40 AM UTC

Yeah ... well, do you mind adding a bit more detail? What do you want to achieve?

Known Participant
Jun 28, 2023 10:00 AM UTC

Hi Stefan ,

I have to make a functionality  like if user click on send button then he will receive an random OTP, as similar when we register on any portal they verified via OTP which we receive on mobile number.

i just want to know can i generate  random  4 digit number after every click .

stefanhelzle0001
Brainy
Jun 28, 2023 11:25 AM UTC

Yes. Did you check the rand() function?

mathieud0001
Genius
Jun 28, 2023 10:36 AM UTC

Why 4 digits?

Here is the RFC for generating proper OTPs and validating them.

[View:https://datatracker.ietf.org/doc/html/rfc6238]

srividyak8611
New Participant
Jun 6, 2024 4:10 PM UTC

For email, you generate a random 4-digit code using random function and dont forgot to convert random to int and then to text, and you can use script task smart service to pass this value in expression and then use Send Email smart service.

iexample: text(int(rand(1) * 10000),"0000")