class OneTimePasswordMethod : AuthenticationMethod.Internal
Manages users of a given identity provider that authenticates users based on their identifier and a generated one-time password sent to them.
Instances of this AuthenticationMethod must be created using the AuthenticationService.getOneTimePasswordMethod method.
This authentication method provides with two call-flows:
class MessageDetails : AuthenticationMethod.Internal.MessageDetails
Specialization of Internal.MessageDetails for OneTimePasswordMethod. |
|
enum class SMSSender
List of all available implementations for sending SMS. |
fun attachIdentity(context: AuthenticationService.Context, displayName: String? = null, profile: Any? = null, messageDetails: OneTimePasswordMethod.MessageDetails? = null, callback: WebcomDoneCallback): Unit
Either creates a new Webcom account and attach an identity to it (if context is Context.New) or attaches a new identity to the Webcom account of the currently authenticated user (if context is Context.Current), as the first step of an identity attachment call-flow. |
|
fun authenticate(oneTimePassword: String, context: AuthenticationService.Context = Context.New, callback: WebcomResultCallback<AuthenticationDetails>? = null): Unit
Authenticates the user with the oneTimePassword s·he has just received, as the final step of an authentication call-flow. This operation is asynchronous and calls the given callback with the authentication result once performed. |
|
fun sendOneTimePassword(messageDetails: OneTimePasswordMethod.MessageDetails? = null, callback: WebcomDoneCallback): Unit
Generates and sends a one-time password to the user, as the first step of an authentication call-flow. This operation is asynchronous and calls the given callback once performed. |
|
fun verifyAndAuthenticate(oneTimePassword: String, callback: WebcomResultCallback<AuthenticationDetails>? = null): Unit
Verify a previously attached identity with the oneTimePassword the user has just received, as the final step of an identity attachment call-flow, and, if successful authenticates the user with this identity (or authentication means). |
fun clearProfile(callback: WebcomDoneCallback? = null): Unit
Clears the profile data of the currently authenticated user stored by the Webcom authentication service. This operation is asynchronous and calls the given callback once performed. |
|
fun setProfile(value: Any?, callback: WebcomDoneCallback? = null): Unit
Sets the value of the profile data of the currently authenticated user stored by the Webcom authentication service. This operation is asynchronous and calls the given callback once performed. |
|
fun updateProfile(path: String, value: Any?, callback: WebcomDoneCallback? = null): Unit
Updates the value of the profile data of the currently authenticated user stored by the Webcom authentication service at a given path. This operation is asynchronous and calls the given callback once performed. |