-
Notifications
You must be signed in to change notification settings - Fork 64
Custom authenticator
Keval Patel edited this page Apr 15, 2018
·
5 revisions
- PasscodeView supports custom authentication methods for authenticating the user using PIN or pattern.
- An application can provide their own PIN or pattern authentication algorithms and hook it into the
PinVieworPatternView. - In another case, the application can create authenticator to send PIN/Pattern entered by the user to the server for the authentication.
- Implement
PinAuthenticatorto the custom authenticator class. - Implement
isValidPin()method with your custom authentication logic. This method will be run in the background thread. -
isValidPin()can provide three different outputs based on the authentication status.-
PinAuthenticationState.NEED_MORE_DIGIT - If the PIN is incomplete.
PinViewwill let the user enter another digit. For the dynamic PIN size, this method will let authenticator decide the correct PIN size. - PinAuthenticationState.SUCCESS - This indicates that the user authentication completed and the user is authenticated.
- PinAuthenticationState.FAIL - This indicates that the user authentication completed. But the user is not authorized.
-
PinAuthenticationState.NEED_MORE_DIGIT - If the PIN is incomplete.
- Check out inbuilt
PasscodeViewPinAuthenticatorfor the reference impementation.
- Implement
PatternAuthenticatorto the custom authenticator class. - Implement
isValidPattern()method with your custom authentication logic. This method will be run in the background thread. -
isValidPattern()will return boolean.-
Trueindicates that the user is authenticated successfully. -
Falseindicates that authentication process completed and the user is not authorized.
-
- Check out inbuilt
PasscodeViewPatternAuthenticatorfor the reference impementation.