verifyIdentity

fun verifyIdentity(provider: String, id: String, data: VerificationData, callback: OnAuth)

Verifies the authentication details (typically msisdn or email address) of a newly created identity using the Webcom.addIdentity method. If the verification is successful, then the user is automatically authenticated with the verified identity.

Parameters

provider

The authentication method associated to the identity to verify. Possible values are "password" or "phone"

id

The identifier to use to authenticate a user with the identity to verify (typically an msisdn or an email address)

data

The verification data needed by the Webcom backend to verify the identity. It must include the code or token received by the user

callback

The callback notified when:

  • the identity has been successfully verified: in this case the OnAuth.onComplete method is called with the verified identity details. In addition, the user is automatically authenticated with this identity and the callback functions registered using .registerAuthCallback are called.

  • the verification has failed: in this case, the OnAuth.onError method is called with the failure reason