Phone

Phone#

This method is used to easily allow users to authenticate with AcceleratXR via their registered phone number. It does not require a password be stored on the account. For that it is considered a password-less authentication method. This method also has the benefit of bypassing any configured multi-factor authentication settings with the account, since it effectively uses a time-based one-time password to function internally.

A user submits an authentication request to the /auth/phone/{phone} endpoint. The system then sends a text message to the phone number (assuming it’s registered) with a time-based one-time password code embedded in the body of the message.

The following example shows the initial request to receive the totp code via phone.

CoreSDK->LoginPhone(_XPLATSTR("phone")).then([](pplx::task<void> task)
{
    try
    {
        // Force the exception to be re-thrown if an error occurred.
        task.get();
    }
    catch (const xbe::sdk::Exception& e)
    {
        // Handle error here
    }
});

Once the code is received the user then submits the provided code to the backend to retrieve the final access token.

 1CoreSDK->LoginPhone(_XPLATSTR("phone"), _XPLATSTR("code")).then([](pplx::task<void> task)
 2{
 3    try
 4    {
 5        // Force the exception to be re-thrown if an error occurred.
 6        task.get();
 7    }
 8    catch (const xbe::sdk::Exception& e)
 9    {
10        // Handle error here
11    }
12});