ios8 TouchID检测是否添加了指纹 [英] ios8 TouchID detection if fingerprint was added

查看:97
本文介绍了ios8 TouchID检测是否添加了指纹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在深入研究Apple的Touch ID,更准确地说是本地身份验证器。
截至目前的文档非常稀少。
主要就是:

Im digging into Apple's Touch ID, more precisely the Local Authenticator. The documentation as of now is pretty sparse. Its mainly just this:

LAContext *myContext = [[LAContext alloc] init];
NSError *authError = nil;
NSString *myLocalizedReasonString = <#String explaining why app needs authentication#>;

if ([myContext canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics    error:&authError]) {
[myContext evaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics
              localizedReason:myLocalizedReasonString
                        reply:^(BOOL success, NSError *error) {
        if (success) {
            // User authenticated successfully, take appropriate action
        } else {
            // User did not authenticate successfully, look at error and take appropriate action
        }
    }];
} else {
// Could not evaluate policy; look at authError and present an appropriate message to user
}

取自 https://developer.apple.com/documentation/localauthentication

使用指纹进行身份验证的想法很不错。但如果我知道密码,我可以在设备中添加指纹。它很容易得到密码,就像你坐在受害者旁边的火车上,看着他/她输入密码。

The idea of using your fingerprint for authentication is nice. But I can add fingerprints in the device if I know the passcode. And its very easy to get the passcode, like you sit in the train next to ur victim and watch him/her enter the passcode.

我想使用指纹作为安全认证的一种方式,但希望能够检测自我上次请求指纹以来是否添加了新指纹。

I want to use the fingerprint as a way of secure authentication but want to be able to detect if new fingerprints were added since the last time I requested the fingerprint.

Apple正在为AppStore做这件事。如果您想在AppStore中对事务进行身份验证,并且自上次事务以来添加了新的指纹,则AppStore会请求您的AppleId-Password。这是理智的行为,因为手机可能已经被知道密码的其他人带走,并添加了自己的指纹来购买昂贵的东西。

Apple is doing this for the AppStore. If you want to authenticate a transaction in the AppStore and have added a new Fingerprint since your last transaction, the AppStore requests your AppleId-Password. This is sane behaviour, because the phone might have been taken by someone else who knows the passcode and added his own fingerprint to buy something expensive.

我的问题:我可以检测到吗?如果自上次使用Local Authenticator以来添加了新指纹?

My Question: Can I detect if a new fingerprint was added since the last time that I used Local Authenticator?

推荐答案

简而言之;没有。

更详细一点; LocalAuthentication 框架是一个严密保护的黑盒子。您从中获得的信息非常有限。您与它的交互是这样的:

In a bit more detail; the LocalAuthentication framework is a tightly-guarded black box. The information you get back from it is very limited. Your interaction with it goes something like this:


  • 询问它是否能够对某种类型的策略进行身份验证(只有1个可用于写作时间 - 生物识别技术(Touch ID))

  • 如果可以,请它实际执行此操作

  • 系统接管实际身份验证

  • 它会告诉您身份验证是否成功(如果没有,它会告诉您原因)

  • Ask it if it's able to authenticate for some type of policy (there is only 1 available at time of writing - Biometrics (Touch ID))
  • If it can, ask it to actually do it
  • The system takes over for the actual authentication
  • It lets you know if the authentication was successful or not (if not, it tells you why)

您没有实际身份验证过程的概念(例如,使用了哪个手指)。当然,这是设计上的。 Apple不希望也不需要让您访问此类信息。

You have no concept of the actual authentication process (which finger was used, for example). This, of course, is by design. Apple does not want, nor need, to give you access to such information.

这篇关于ios8 TouchID检测是否添加了指纹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆