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.

          • Jeremy Lopez

            What data can you use for login if there isn’t anything returned to you? I need multiple users to be able to sign in from one device

      • 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?

    • Jeremy Lopez

      I totally agree with the second point. This doesn’t help me implement TouchID in a real world context. How can I use the fingerprint to login to an account?

  • Ori C.

    I getting a black screen on device, and in the browser I see an “Uncaught (in promise): Error: No provider for TouchID! ”

    Any ideas why?

  • Ameet Ayare

    Alex, great post. Just getting started with ionic. Being a bit lazy to check but are there plugins for androids finger print auto too?