OTP flow
Validate OTP
Define needed Kafka topics
Kafka topic names can be set by using environment variables:
KAFKA_TOPIC_OTP_VALIDATE_IN
- the event sent on this topic (with an OTP and an identifier) will check if the OTP is validKAFKA_TOPIC_OTP_VALIDATE_OUT
- the response for this request will validate an OTP, the reply is sent back to the Engine on this topic
You can check the defined topics by going to FlowX Designer > Platform Status > notification-plugin-mngt > kafkaTopicsHealthCheckIndicator > details > configuration > topic > otp.
The Engine is listening for messages on topics with names of a certain pattern, make sure to use an outgoing topic name that matches the pattern configured in the Engine.
Request to validate an OTP
Values expected in the request body:
- processInstanceId = process instance ID
- client id = the user unique ID in the system
- channel = notification channel: SMS/MAIL
- otp = OTP code that you received, used to compare with the one that was sent from the system
Example:
Reply from validate OTP
Values expected in the reply body:
- client id = the user unique id in the system
- channel = notification channel used
- otpValid = confirmation if the provided OTP code was the same as the one sent from the system
Example:
Example: validate an OTP from a business flow
Similar to the generation of the OTP you can validate the OTP that was generated for an identifier.
- Check that the needed topics are configured correctly: (
KAFKA_TOPIC_OTP_VALIDATE_IN
andKAFKA_TOPIC_OTP_VALIDATE_OUT
) - Add the actions for sending the request to validate the OTP on the node that contains the ‘Generate OTP’ actions
- Add the proper configuration to the action, the Kafka topic and configure the body message.
- Add a node to the process definition (for the Receive Message Task)
- Configure on what key you want to receive the response on the process instance parameters
Was this page helpful?