Titanium JIRA Archive
Appcelerator Modules (MOD)

[MOD-2211] TouchId: Add alternative login method using passcode

GitHub Issuen/a
TypeImprovement
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2016-12-28T18:23:24.000+0000
Affected Version/sn/a
Fix Version/sRelease 6.1.0
ComponentsTouchID
LabelsVMWare, iOS
ReporterMostafizur Rahman
AssigneeHans Knöchel
Created2016-03-18T10:14:06.000+0000
Updated2017-02-14T18:09:05.000+0000

Description

In Touch Id module, users can login using Touch ID only but if add another alternative method using passcode in this module then users can log in easily. This login features already available in native code. So customer request this features as a alternative login method.

Comments

  1. Shak Hossain 2016-03-18

    *Here is the exact use case:* - For all the iPhone users who have the Touch ID enable on their phone: - Whenever user launches the App, it should prompt the user for Touch ID. - If the Touch ID authentication fails after 'n' or 3 number of re-tries, we should have the user to enter his device passcode.
  2. Shak Hossain 2016-03-18

    *Customer Sample Code:*
       TouchId.authenticate({
       reason : L("touchId.loginMessage"),
       callback : callback
        
       });
       
       //where callback is below function -
        
       function touchAuthCallback(obj) {
       log.trace("[login] >> [touchAuthCallback] >> TouchId callback execution started...");
        
       if (obj.error == undefined) {
       if (obj["success"] === true) {
       log.trace("[login] >> [touchAuthCallback] >> Calling doClick to initiate Login...");
        
       setTimeout(
       function() {
       doClick();
       },
       200);
       }
       } else {
       log.error("[login] >> [touchAuthCallback] >> err:", obj.error);
       $.password.setValue("");
       Alloy.Globals.touchIdOnResume = false ;
       Alloy.Globals.touchIdInAction = false ;
        
       }
       }
       
       
  3. Shak Hossain 2016-03-18

    *Related Post:* This was proposed but not acceptable by customer https://gist.github.com/csemrm/df08876d2bf09fe4785a
  4. Hans Knöchel 2016-03-20

    As discussed on Flowdock, I'm pretty sure it's not exposed by iOS (for now). Anyway, if they can provide a native example that does it, we'd be able to solve that easily.
  5. Hans Knöchel 2016-12-28

    I got something. More soon.
  6. Hans Knöchel 2016-12-28

    Fixed as part of TIMOB-20547. Example:
       // Or: AUTHENTICATION_POLICY_BIOMETRICS for the default behavior
       TiTouchId.setAuthenticationPolicy(TiTouchId.AUTHENTICATION_POLICY_PASSCODE); 
       
       // Check device support and  authenticate like before ...
       
  7. Lee Morris 2017-02-14

    Verified that this works fine, tested with; iPhone 7 (10.2) MacOS 10.11.6 (15G31) Studio 4.8.1.201612050850 Ti SDK 6.1.0.v20170213134957 Appc NPM 4.2.8 Appc CLI 6.2.0-12 Ti CLI 5.0.11 Alloy 1.9.6 Arrow 1.10.2 Xcode 8.2 (8C38) Node v4.6.0 Java 1.7.0_80

JSON Source