otp-service
Reactive icon

OTP Service

Stable version 1.0.1 (Compatible with OutSystems 11)
Uploaded
 on 18 July 2023
 by 
5.0
 (2 ratings)
otp-service

OTP Service

Details
OTPService is a forge component which helps in user authentication via OTP. This application has 2 modules inside “OTP_CS” and “OTP_Utils”. In this the “OTP_CS” has its dependency on “OTP_Utils” and “OTP_Utils” is dependent on SID forge component of “Twilio Connector”.
Read more

OTPServices


Details

OTPService is a forge component which helps in user authentication via OTP. This application has 2 modules inside “OTP_CS” and “OTP_Utils”. In this the “OTP_CS” has its dependency on “OTP_Utils” and “OTP_Utils” is dependent on SID forge component of “Twilio Connector”.


How to use this plugin?

  • In the login screen assign a client action to the login button. Inside the client action add the server action “Validate Credentials” which is from the OTP_CS module. This can be done by adding dependency of “OTP_Services” to your application.
  • After the server action has been successfully added, the server action requires 2 values as input parameter i.e., Username and Password, assign both of then respective value entered by the user.
  • Add a “If” condition to check if the output parameter “IsValid” of Boolean data type is true or not, if true the flow must be directed towards the next screen e.g., “Verify OTP”. If the value was found false the flow must be directed towards “End Node” but a message notification that “The credentials are not valid “is recommended to be shown.
  • Add input parameter named “Username” and “Token number” in next screen. This input parameter must be assigned Username entered by the user and the token number which is the output parameter of the “Validate Credentials”.


                                    The logic flow of the above Client action must look like this.


  • Now in the next screen e.g., “Validate OTP” must have a button that call a client action to verify the OTP.
  • Inside Client action add the server action “ValidateOTP” from the module “OTP_CS”. This action has 2 input parameter “Token” and “OTP”, it must be assigned the input parameter value of next screen from step4 and the OTP entered by the user respectively.
  • The “ValidateOTP” server action has an output parameter which returns a Boolean value to tell if the OTP entered by the user is correct and matches or not. This condition must be checked in the flow through an “If” condition.
  • If the value returned is “True” the user must be directed to the main flow screens e.g., Homescreen. Make sure the home screen must have an input parameter UserId and its value must be “GetUserId()”.
  • If the value returned is false the flow must end with an end node but in between a notification message “Invalid OTP” is recommended to be show.


                                  The logic flow of the above Client action must look like this.


  • The screen must also have a link so that a new OTP is sent due to the probability that the user must not have received the OTP.
  • The link must be associated to a new client action that triggers a server action “ResendOTP” which is a server action from “OTP_CS”. This server action has an input parameter “Token” which must be passed the value of “TokenInput” which is the input variable of the current screen.
  • After step11 the flow must end by redirecting it to the current screen which again has input parameter “TokenInput” and “Username” whose values must be passed as the 2 output parameters of the “OTP_Resend” server action as “Resend_OTP.TokenOutput” and “Resend_OTP.Username” respectively.


                               The logic flow of the above Client action must look like this.


OTP_Utils


Details

This is a reactive application which has only 2 server actions named “SendEmail” and “SendOTP” which triggers send OTP by Email and OTP by SMS respectively as the name suggest. The module “OTP_CS” has its dependency over this module. 


Variables used in Utils module


SendOTP

  • Email
  • OTP

SendSMS

  • OTP
  • PhoneNumber


OTP_CS


Details

Designed for mobile and reactive web apps, this module helps send, verify, resend or expire OTP. See the complete list of variables below used in this service application.


Variables used in the service application.

4 server actions excluding the CRUD actions.


OTP_Expired

This server action is associated with timer that if any of the OTP whose StatusId is still open after the OTP has been sent for more than 10min, such OTP StatusId must be updated to expired.

Resend_OTP

  • Token
  • IsResend
  • TokenTnput
  • Username
  • OTP

ValidateCredentials

  • Username
  • Password
  • IsValid
  • TokenOutput
  • MFA
  • Email

ValidateOTP

  • Token
  • OTP                                                                        
  • Validate
  • 3 CRUD operation name under the folder “OTP_CRUD”


                                                      All Server actions in OTP_CS.


OTP_CreateOrUpdate

  • OTP

OTP_Delete

  • OTP

OTP_SetAsInActive

  • OTP



OTP Demo App


Details

The OTP demo module has been named as “OTP_DEMO” under “OTP_Service” application. You’ll be able to see an example of how the current version of the “OTP_CS” can be implemented in an app that allows you to verify credentials of the user variables, send OTP through Email or SMS and redirects to the OTP verification screen. On OTP verification screen user has to enter the OTP that has been send to the respective email or phone number, also “Resend OTP?” a new feature has been added to the OTP verification screen to make sure user receives another OTP.


                                                      Login Screen Of OTP_Demo.


                                                       Verify OTP screen of OTP_DEMO.

Release notes (1.0.1)

Improvement and bug fixes.

License (1.0.1)
Reviews (0)
Team
Other assets in this category