One Time Password Method
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:
Authentication call-flow:
Call sendOneTimePassword to send a generated one-time password to the user,
Call authenticate to authenticate the user.
Attach a new identity (or authentication means) to a user account:
Call attachIdentity to associate the currently authenticated user with a new email address or phone number (depending on the chosen provider),
Call verifyAndAuthenticate to verify the newly created identity.
Types
MessageDetails
Link copied to clipboard
class MessageDetails @JvmOverloads() constructor(template: String?, locale: Locale?, sender: String?) : AuthenticationMethod.Internal.MessageDetails
Content copied to clipboard
Functions
attachIdentity
Link copied to clipboard
fun attachIdentity(context: AuthenticationService.Context, displayName: String? = null, profile: Any? = null, messageDetails: OneTimePasswordMethod.MessageDetails? = null, callback: WebcomDoneCallback)
Content copied to clipboard
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.
authenticate
Link copied to clipboard
@JvmOverloads()
Content copied to clipboard
Authenticates the user with the oneTimePassword s·he has just received, as the final step of an authentication call-flow.
clearProfile
Link copied to clipboard
sendOneTimePassword
Link copied to clipboard
fun sendOneTimePassword(messageDetails: OneTimePasswordMethod.MessageDetails? = null, callback: WebcomDoneCallback)
Content copied to clipboard
setProfile
Link copied to clipboard
@JvmOverloads()
Content copied to clipboard
Sets the value of the profile data of the currently authenticated user stored by the Webcom authentication service.
updateProfile
Link copied to clipboard
@JvmOverloads()
Content copied to clipboard
verifyAndAuthenticate
Link copied to clipboard
@JvmOverloads()
Content copied to clipboard
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).