/**
  * Called when the authentication process completes (see attemptLogin()).
  *
  * @param result
  */
 public void onAuthenticationResult(final boolean result) {
   if (result) {
     if (!confirmCredentials) {
       finishLogin();
     } else {
       finishConfirmCredentials(true);
     }
   } else {
     Timber.d("onAuthenticationResult: failed to authenticate");
     if (requestNewAccount) {
       Toaster.showLong(
           BootstrapAuthenticatorActivity.this, string.message_auth_failed_new_account);
     } else {
       Toaster.showLong(BootstrapAuthenticatorActivity.this, string.message_auth_failed);
     }
   }
 }
 @Subscribe
 public void onUnAuthorizedErrorEvent(UnAuthorizedErrorEvent unAuthorizedErrorEvent) {
   // Could not authorize for some reason.
   Toaster.showLong(BootstrapAuthenticatorActivity.this, R.string.message_bad_credentials);
 }