-
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
PinView
orPatternView
. - In another case, the application can create authenticator to send PIN/Pattern entered by the user to the server for the authentication.
- Implement
PinAuthenticator
to 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.
PinView
will 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
PasscodeViewPinAuthenticator
for the reference impementation.
- Implement
PatternAuthenticator
to 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.-
True
indicates that the user is authenticated successfully. -
False
indicates that authentication process completed and the user is not authorized.
-
- Check out inbuilt
PasscodeViewPatternAuthenticator
for the reference impementation.