-
Notifications
You must be signed in to change notification settings - Fork 64
Inbuilt authenticator
Keval Patel edited this page Apr 15, 2018
·
2 revisions
- PasscodeView provides two inbuilt authenticators. One for PIN authentication and another for pattern authentication.
- PasscodeViewPinAuthenticator
- PasscodeViewPatternAuthenticator
-
PasscodeViewPinAuthenticator
matches each digit into the PIN entered by the user with the correct PIN provided by the application. - If both the PIN has same digits in same order, it will mark authentication as successful or else mark it as failed.
- You can hook
PasscodeViewPinAuthenticator
withPinView
as follow:final int[] correctPin = new int[]{1, 2, 3,4}; //Create authenticator with above correct PIN final PasscodeViewPinAuthenticator authenticator = new PasscodeViewPinAuthenticator(correctPin) pinView.setPinAuthenticator(authenticator);
-
PasscodeViewPatternAuthenticator
matches eachPatternPoint
draw by the user with the correctPatternPoint
provided by the application. - If both the
PatternPoint
has same row and column numbers in same order, it will mark authentication as successful or else mark it as failed. - You can hook
PasscodeViewPatternAuthenticator
withPatternView
as follow:final PatternPoint[] correctPattern = new PatternPoint[]{ new PatternPoint(0, 0), new PatternPoint(1, 0), new PatternPoint(2, 0), new PatternPoint(2, 1) }; //Create authenticator with above correct pattern final PasscodeViewPatternAuthenticator authenticator = new PasscodeViewPatternAuthenticator(correctPattern) patternView.setAuthenticator(authenticator);