sendOtp

fun sendOtp(provider: String, id: String, messageDetails: MessageDetails?, callback: OnValue)

Sends a one time password to a user. Such a temporary password may then be used to authenticate the user using the Webcom.authInternally method.

Parameters

provider

The authentication method associated to the OTP to send. Possible values are "password" or "phone"

id

The identifier of the user whom to send the OTP to for the chosen provider. For the "password" provider, it is expected to be an email address, for the "phone" provider, it is expected to be a msisdn

messageDetails

Template of message used to send the OTP (among the messages defined on the Webcom developer console)

callback

The callback called when the sending is completed or fails. In case of success, the OnValue.onValue method receives the identifier of the send OTP (or challenge) as a JSONValue. Typically, this challenge is required by the Webcom.authInternally method.

fun sendOtp(provider: String, id: String, callback: OnValue)

Sends a one time password to a user using the default "login" message template.

See also

Parameters

provider

The authentication method associated to the OTP to send. Possible values are "password" or "phone"

id

The identifier of the user whom to send the OTP to for the chosen provider. For the "password" provider, it is expected to be an email address, for the "phone" provider, it is expected to be a msisdn

callback

The callback called when the sending is completed or fails. In case of success, the OnValue.onValue method receives the identifier of the send OTP (or challenge) as a JSONValue. Typically, this challenge is required by the Webcom.authInternally method.