Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

 

Explain that first factor and other forms of second factor authentication is up to the developer as to how they want to implement it.

SurePassIdU2fSign

 

The Sign In Activity must extend SurePassIdU2fSignActivity. It must implement the following abstract methods.

...

 


public interface Listener {
/**
* Method used to go to the target activity after U2F Sign succeeds.
*/
 void gotoTargetActivity();

/**
* Method used to go to an activity that provides the user the ability
* to use a different second factor method if they are unable to use
* a U2F Authenticator.
*/
 void gotoAlternateVerificationActivity();

/**
* Called if the U2F Sign operation was canceled by the user.
*/
 void u2fSignCanceled();

/**
* Called if there was an error during the U2F Sign Operation.
*
* @param errorMessage The error that occurred.
*/
 void u2fSignError(CharSequence errorMessage);
}
Code Block
languagejava
titleSurePassIdU2fSign
linenumberstrue
public class DemoSignInActivity extends Activity implements SurePassIdU2fSign.Listener {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    initUi();
    mU2fSign = new SurePassIdU2fSign(this, this);
}

@Override
public void gotoTargetActivity() {
    Intent intent = new Intent(this, DemoAppActivity.class);
    startActivity(intent);
}

@Override
public void gotoAlternateVerificationActivity() {
    Intent intent = new Intent(this, DemoEnterOtpActivity.class);
    startActivity(intent);
}

@Override
public void u2fSignCanceled() {
    resetFormValues();
    enableForm();
    displayMessage("Sign In canceled.");
}

@Override
public void u2fSignError(CharSequence errorMessage) {
    displayMessage(errorMessage);
    enableForm();
}
}

 

Upon successfully authenticating the user it should call

...