Titanium JIRA Archive
Appcelerator Modules (MOD)

[MOD-2356] iOS: Ti.TouchID - Expose "keepAlive" property to properly manage auth-contextlifetime

GitHub Issuen/a
TypeNew Feature
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2017-11-10T19:26:34.000+0000
Affected Version/sn/a
Fix Version/sRelease 7.0.0, Ti.TouchID 2.1.5
ComponentsTouchID
Labelsn/a
ReporterHans Knöchel
AssigneeHans Knöchel
Created2017-08-31T14:00:54.000+0000
Updated2017-11-16T02:48:16.000+0000

Description

As a follow-up of TIMOB-25181, we should expose the keepAlive boolean-property, so iOS devices (especially iOS 8) can terminate the current auth-context properly.

Comments

  1. Hans Knöchel 2017-08-31

    PR: https://github.com/appcelerator-modules/ti.touchid/pull/34 Test-case 1/3:
       var TouchID = require("ti.touchid");
       
       var win = Ti.UI.createWindow({
         backgroundColor: '#fff'
       });
       
       var btn = Ti.UI.createButton({
         title: 'Trigger'
       });
       
       TouchID.setAuthenticationPolicy(TouchID.AUTHENTICATION_POLICY_PASSCODE);
       btn.addEventListener('click', function() {
         TouchID.authenticate({
           reason: 'Can we?',
           keepAlive: false,
           callback: function(e) {
             console.log(e);
           }
         });
       });
       
       win.add(btn);
       win.open();
       
    Test-case (2/3):
       var TouchID = require("ti.touchid");
       
       var win = Ti.UI.createWindow({
         backgroundColor: '#fff'
       });
       
       var btn = Ti.UI.createButton({
         title: 'Trigger'
       });
       
       TouchID.setAuthenticationPolicy(TouchID.AUTHENTICATION_POLICY_PASSCODE);
       btn.addEventListener('click', function() {
         TouchID.authenticate({
           reason: 'Can we?',
           callback: function(e) {
             console.log(e);
           }
         });
       });
       
       win.add(btn);
       win.open();
       
    Test-case (3/3):
       var TouchID = require("ti.touchid");
       
       var win = Ti.UI.createWindow({
         backgroundColor: '#fff'
       });
       
       var btn = Ti.UI.createButton({
         title: 'Trigger'
       });
       
       TouchID.setAuthenticationPolicy(TouchID.AUTHENTICATION_POLICY_PASSCODE);
       btn.addEventListener('click', function() {
         TouchID.authenticate({
           reason: 'Can we?',
           callback: function(e) {
             console.log(e);
             TouchID.invalidate();
           }
         });
       });
       
       win.add(btn);
       win.open();
       
    Expected behaviors: - 1) Auth-text get's invalidated, the prompt is shown every time - 2) Auth-text is kept alive, the prompt is shown until invalidated by the system - 3) Auth-text get's invalidated by calling invalidate(), the prompt is shown every time
  2. Abir Mukherjee 2017-11-10

    Passed FR and merged.

JSON Source