addIdentity

fun addIdentity(provider: String, details: AuthDetails, messageDetails: MessageDetails?, callback: OnAuth?)

Adds a new account to the app referred to by this Webcom instance. The new account is associated to a new identity with the provider authentication method, whose details (typically msisdn, email or password) are provided by the details parameter. Currently, only 2 authentication methods are available to add an account: "password" (authentication with email and password) or "phone" (authentication with msisdn and one-time-password).

The identity associated to the newly added account is in the unverified state, so that the actual user cannot authenticate with this identity until it has been verified. To to so, the user receives a verification code or token on the specified msisdn ("phone" method) or email address ("password" method), which must be sent back to the Webcom backend using the Webcom.verifyIdentity method.

Parameters

provider

The authentication method required by the identity associated to the added account. Possible values are "password" or "phone"

details

The details of the identity associated to the added account (depends on the chosen authentication method)

messageDetails

Settings of the message to be sent to the user to verify her/his identity

callback

The callback notified when:

  • the account has been successfully added: in this case, the OnAuth.onComplete method is called with the details of the identity associated to the newly created account,

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

fun addIdentity(provider: String, details: AuthDetails, callback: OnAuth)

Adds a new account to the app referred to by this Webcom instance. See Webcom.addIdentity.

Parameters

provider

The authentication method required by the identity associated to the added account. Possible values are "password" or "phone"

details

The details of the identity associated to the added account (depends on the chosen authentication method)

callback

The callback notified when:

  • the account has been successfully added: in this case, the OnAuth.onComplete method is called with the details of the identity associated to the newly created account,

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