Signup for the Ionic Newsletter to get the latest news and updates!

  • http://www.raymondcamdencom/ Raymond Camden

    2 questions:

    Don’t you need to wait for the IonicPlatform ready event? It’s possible for the view to load *before* device plugins are ready. It’s probably rare, but still – you should wait, right? (This certainly applied to Ionic 1 apps.)

    Secondly, and this may be a bit too nit picky for a blog example, but in the real world, you would only enable TouchID after one successful login so you would know who the user is. TouchID just verifies the owner of the device is using it, but the app has no knowledge of who that is. So you would need to store credential info and access it on a successful TouchID.

    • Alex Muramoto

      You are correct! I’ve updated the sample to use platform.ready() instead of ionViewLoaded. In most cases I think ionViewLoaded would have the expected result, but it’s true that you can’t be 100% positive there.

      On the second point, also true, but this is just a simple sample to show how to implement Touch ID. I’m planning a future post on properly integrating it into an auth flow, which is a better place to cover the details like what you’re mentioning.

      • St├ęphane Chan-kam

        From what I see from your example, the success function is not returning anything that could help us to identify a user in a unique way (it would have been awesome if it would return a unique token for every unique fingerprint). Correct me if I’m wrong, but I am not sure that it will be good to use TouchID in a login flow.

        • Keith D. Moore

          Login is the primary usecase for TouchID. I’m sure there might be others, but login is probably the most common by far.

      • Mark Lontsman

        Hi, curious if there is an update to this. All examples that I have seen only show device level authentication. Are there updated examples that show how fingerprint authentication can be associated with a new or existing app user?