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.
/** |
---|
SurePassIdU2fSign
public class DemoSignInActivity extends Activity implements SurePassIdU2fSign.Listener { private SurePassIdU2fSign mU2fSign; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); initUi(); mU2fSign = new SurePassIdU2fSign(this, this); } void afterLoginSuccess(String username) { mU2fSign.u2fSign("https://u2f.server.com/example", username); } @Override public void onActivityResult(int requestCode, int resultCode, Intent intent) { mU2fSign.onActivityResult(requestCode, resultCode, intent); } @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
protected void u2fSign(String username)
That method will perform all the necessary U2F operations.