简体   繁体   中英

Can we generate string from LocalAuthentication ios?

I need to ask a very basic question. I have read about LocalAuthentication and its uses but still need to clear if there is any way to do following thing ?

If I want to generate string from Touch ID is that possible ? Because current behaviour of this framework is :

  • framework asks user for his Touch ID
  • get the Touch and compares it with the each one (among five) stored in keychain
  • if found returns true else false.

Is there anyway that if I want to grab this string generated by LAContext ? Possibly a noob question but just for clarification.

The TouchID information is a complete and utter black box.

When you launch a request to LAContext evaluatePolicy:localizedReason:reply the only informaiton you get to supply to TouchID is the display string explaining to the user the reason for the prompt.

In the "reply" block, you only have a boolean to indicate success or failure, and in the event of a failure, you will have an LAError indication why it failed, although even that information is limited:

enum LAError : Int {
    case AuthenticationFailed
    case UserCancel
    case UserFallback
    case SystemCancel
    case PasscodeNotSet
    case TouchIDNotAvailable
    case TouchIDNotEnrolled
    case TouchIDLockout
    case AppCancel
    case InvalidContext
}

Under no circumstance will iOS ever give you any information regarding the fingerprints read during this process, regardless of the outcome.

They will not give you any identifier, nor will they even tell you which of the 10 allowable fingerprints was matched in the event of a success.

So the answer to your question is no, you cannot use the fingerprint reader to generate a unique string.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM