Features: Mobile SDK

Fingerprint Sessions Lock

Support phone unlocking using fingerprint recognition.

A Modern Alternative

The Mobile SDK allows you to incorporate modern devices capabilities to lock and unlock using fingerprint recognition as an authentication alternative to using passwords.

A Modern Alternative

The Mobile SDK allows you to incorporate modern devices capabilities to lock and unlock using fingerprint recognition as an authentication alternative to using passwords.

Fast and Secure

The user’s fingerprint is compared against the image that is stored in the secure area on the chipset.

Fast and Secure

The user’s fingerprint is compared against the image that is stored in the secure area on the chipset.

Multiple users

Local device authentication using fingerprints can store multiple fingerprints, including the owner and people who the owner trusts.

Multiple users

Local device authentication using fingerprints can store multiple fingerprints, including the owner and people who the owner trusts.



Implementation Highlights

The Mobile SDK supports session lock/unlock using device Fingerprint Session Lock and device Screen Lock with Pattern/PIN/Password. Because the app user can use one, both, or no locking method at all, you need to handle all of these scenarios. If the device is configured without any lock method, the Mobile SDK returns an error that device lock security is missing.

Code Sample

All of the backend complexity is abstracted away, so your interaction with the iOS Mobile SDK looks simply like this:

Lock User Session

    // Lock the application whenever it is inactive.
@Override
protected void onPause() {
    MASUser currentUser = MASUser.getCurrentUser();
    if (currentUser != null) {
        currentUser.lockSession(null);
    }
    super.onPause();
}

Unlock User Session

A complete implementation of this workflow is provided in MASSessionUnlockActivity.

    // Unlock the application whenever it is active.
@Override
protected void onResume() {
    super.onResume();
    MASUser currentUser = MASUser.getCurrentUser();
    if (currentUser != null) {
        currentUser.unlockSession(getUnlockCallback());
    }
}

// Callback for unlockSession()
public MASSessionUnlockCallback<Void> getUnlockCallback() {
    return new MASSessionUnlockCallback<Void>() {
        @Override
        public void onSuccess(Void result) {
            // The session was successfully unlocked
        }

        @Override
        public void onError(Throwable e) {
            // Handle errors
        }

        @Override
        @TargetApi(23)
        public void onUserAuthenticationRequired() {
            // Handle user authentication
            launchKeyguardIntent();
        }
    };
}

protected int REQUEST_CODE = 0x1000;
    
// Launch the default Android lockscreen to authenticate the user
private void launchKeyguardIntent() {
    KeyguardManager keyguardManager = (KeyguardManager) getSystemService(Context.KEYGUARD_SERVICE);
    Intent intent = keyguardManager.createConfirmDeviceCredentialIntent("Confirm your pattern",
            "Please provide your credentials.");
    if (intent != null) {
        startActivityForResult(intent, REQUEST_CODE);
    }
}

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    if (requestCode == REQUEST_CODE) {
        if (resultCode == RESULT_OK) {
            // The session was successfully unlocked
        } else if (resultCode == RESULT_CANCELED) {
            // The Android lockscreen Activity was cancelled
        }
    }
    super.onActivityResult(requestCode, resultCode, data);
}

More code samples:

Chat
What would you like to chat about?
Contact
Call us at +1-800-225-5224
Call us at +1-800-225-5224
Contact Us