1

I am working on an application which uses Touch ID. I have integrated the Touch ID into the app to authenticate the user to access some app elements and it works fine.

LAContext *context = [[LAContext alloc] init];

NSError *error = nil;
if ([context canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics error:&error]) {
    [context evaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics localizedReason:@"Are you the device owner?" reply:^(BOOL success, NSError *error) {
          if (error) {
              UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error"
                                                              message:@"There was a problem verifying your identity."
                                                             delegate:nil
                                                    cancelButtonTitle:@"Ok"
                                                    otherButtonTitles:nil];
              [alert show];
              return;
          }
          NSLog(@"%@",context);
          if (success) {
              UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Success"
                                                              message:@"You are the device owner!"
                                                             delegate:nil
                                                    cancelButtonTitle:@"Ok"
                                                    otherButtonTitles:nil];
              [alert show];
          } else {
              UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error"
                                                              message:@"You are not the device owner."
                                                             delegate:nil
                                                    cancelButtonTitle:@"Ok"
                                                    otherButtonTitles:nil];
              [alert show];
          }

      }];
} else {
    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error"
                                                    message:@"Your device cannot authenticate using TouchID."
                                                   delegate:nil
                                          cancelButtonTitle:@"Ok"
                                          otherButtonTitles:nil];
    [alert show];
}

Now, suppose if there are 2 fingerprints like Alice and Bob. Authentication works for both the fingerprints without any issue.

But I need to show which fingerprint user has been authenticated.

Is there any way to access it?

rmaddy
  • 314,917
  • 42
  • 532
  • 579
remyr3my
  • 768
  • 1
  • 6
  • 19

1 Answers1

2

How would you even know which user is which? They don't have names, and there's no identity management substrate built into iOS.

You just have to trust that if the person who has added fingerprints is trusting someone else by adding their fingerprint, they gain access to everything TouchID authorizes.

brandonscript
  • 68,675
  • 32
  • 163
  • 220