1

I'm trying to use biometrics to login to a webView application. I came across LAContext.hash() which you can run in your evaluatePolicy method. It generates a 10 digit Int. I tried it multiple times and it always returns the same number.

Any of you might know if it's unique? Can I use it for authentication?

Note: this is not a native app. I'm trying to leverage iOS biometrics to login to my WebView application.

if authenticationContext.canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, error: &error){

authenticationContext.evaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, localizedReason: "scan ... ", reply: { (success, error) in
    if success{
        let authenticatedHash:Int = LAContext.hash()
        print(authenticatedHash)
    } else {
        if let error = error as NSError? {
        }
    }
}
rmaddy
  • 314,917
  • 42
  • 532
  • 579
John Lock
  • 11
  • 1
  • 1
    That is from `Hashable`. It has nothing to do with any kind of authentication or authorization. It's probably a memory address. All you get from `evaluatePolicy` is a true or false based on whether the user authenticated or not. – rmaddy Dec 20 '17 at 04:49
  • I don't think it's a memory address. as it's always the same 10 digit number + I put LAContext.hash() inside the success so I can be sure the user has been authenticated, I didn't mean it's part of evaluatePolicy. do you know any way that I can use bio-metrics to login to webView ? – John Lock Dec 20 '17 at 18:46
  • Either way, using `hash` is definitely NOT to be used in any way related to authorization or authentication. If you have a new question about using `LAContext` to log into a web view you should post a new question specific to that. – rmaddy Dec 20 '17 at 19:11

0 Answers0