Skip to main content
Version: 5.7.0

SmartSwitchAuthenticateEmailPassword

Smart Switch Authenticate will logout of the current profile, and switch to the new authentication type. In event the current session was previously an anonymous account, the smart switch will delete that profile. Use this function to keep a clean designflow from anonymous to signed profiles

Authenticate the user with a custom Email and Password. Note that the client app is responsible for collecting and storing the e-mail and potentially password (for convenience) in the client data. For the greatest security, force the user to re-enter their password at each login (or at least give them that option).

Method Parameters

ParameterDescription
emailThe e-mail address of the user
passwordThe password of the user
forceCreateShould a new profile be created for this user if the account does not exist?

Usage

http://localhost:3000
string email ="email@bitheads.com";
string password = "password";
bool forceCreate = true;

SuccessCallback successCallback = (response, cbObject) =>
{
Debug.Log(string.Format("[Authenticate Success] {0}", response));
};
FailureCallback failureCallback = (status, code, error, cbObject) =>
{
Debug.Log(string.Format("[Authenticate Failed] {0} {1} {2}", status, code, error));
};
_bc.SmartSwitchAuthenticateEmail(
email, password, forceCreate, successCallback, failureCallback);
JSON Response
var email ="email@bitheads.com";
var password = "password";
var forceCreate = true;

_bc.smartSwitchAuthenticateEmailPassword(email, password, forceCreate, result =>
{
var status = result.status;
console.log(status + " : " + JSON.stringify(result, null, 2));
});