Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save marchbold/117232c7e5134894af53e3b83ea5dbd0 to your computer and use it in GitHub Desktop.
Save marchbold/117232c7e5134894af53e3b83ea5dbd0 to your computer and use it in GitHub Desktop.
Local Authentication with a user's fingerprint (TouchID) using the LocalAuth ANE
if (LocalAuth.service.canAuthenticateWithFingerprint())
{
// Fingerprint authentication is available
LocalAuth.service.addEventListener( LocalAuthEvent.AUTH_SUCCESS, authSuccessHandler );
LocalAuth.service.addEventListener( LocalAuthEvent.AUTH_FAILED, authFailedHandler );
LocalAuth.service.authenticateWithFingerprint( "Unlock access to locked feature" );
}
private function authSuccessHandler( event:LocalAuthEvent ):void
{
trace( "localAuth_authSuccessHandler" );
}
private function authFailedHandler( event:LocalAuthEvent ):void
{
trace( "localAuth_authFailedHandler: " + event.errorCode + "::" +event.message );
}
// com.distriqt.LocalAuth
@marchbold
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment