Add new method to request Pin/Biometric authentication from bridge
dpastor opened this issue · 4 comments
dpastor commented
Due this spec, we need to provide the following bridge method:
Trigger Pin/Biometric Authentication
This method allows triggering Pin/Biometric authentication if necessary, taking into account 3 possible scenarios:
- User has Pin/Biometric already configured in the app
- Last previous authentication (or last pin/biometric setup) is still valid.
- Nothing will be presented to user and bridge method will success.
- Last previous authentication (or last pin/biometric setup) is not valid.
- Authentication will be required, blocking the user until it is performed.
- Last previous authentication (or last pin/biometric setup) is still valid.
- In any other case:
- User will be taken directly to the screen where he can introduce a new PIN and enable any other authentication methods.
- In case user leaves the screen without providing an authentication method, bridge method will fail with 401 code.
- User will be taken directly to the screen where he can introduce a new PIN and enable any other authentication methods.
Js method
triggerPinOrBiometricAuthentication: ({
maxSecondsSinceLastValidation: number;
}) => Promise<{
result: 'USER_AUTHENTICATED' | 'USER_ENABLED_AUTHENTICATION' | 'LAST_AUTHENTICATION_STILL_VALID';
}>
Message type
TRIGGER_PIN_OR_BIOMETRIC_AUTHENTICATION
Request Payload
maxSecondsSinceLastValidation: number
- If time elapsed since last authentication is less than the number of seconds specified here, authentication will succeed without requesting it again
Success Response Payload
result: 'USER_AUTHENTICATED' | 'USER_ENABLED_AUTHENTICATION' | 'LAST_AUTHENTICATION_STILL_VALID'
Error response codes
401 → Unauthorized
dpastor commented
@dpastor, should we have a default value for
maxSecondsSinceLastValidation
?
No, Vivo will just always set time they want.
atabel commented
Ok, LGTM. Jira ticket: https://jira.tid.es/browse/WEB-1844
marcoskolodny commented
Small question @dpastor: what is the minimum required App version that supports this method?