C++ and QML library for biometric authentication (e.g. Touch ID)
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
.qmake.conf
LICENSE
README.md
qtlocalauthenticator.pro
sync.profile

README.md

QtLocalAuthenticator

C++ and QML library for biometric authentication (e.g. Touch ID)

  1. installation
qmake
make
make install
  1. C++ module

2.a. adding to your .pro file

...
QT += localauthenticator
...

2.b. sample code

QLocalAuthenticator authenticator;
authenticator.setReason("Access your private information!");
authenticator.setPolicy(QLocalAuthenticator::PolicyWithBiometricsOrPassword);

connect(&authenticator, &QLocalAuthenticator::authenticationFinished,
        &myFancyClass, &MyFancyClass::authenticationFinished);

...
void MyFancyClass::authenticationFinished(bool success,
        QLocalAuthenticator::AuthenticationFailureReason reason)
{
    if (success)
        qWarning("Authentication was successful!");
    else
        qWarning("Authentication failed! reason = %d", reason);
}
  1. QML module

3.1. sample code

...
import jsee23.authenticator 0.1

...
    LocalAuthenticator {
        id: authenticator
        reason: "Get access to your private information!"
        policy: LocalAuthenticator.PolicyWithBiometricsOrPassword
        onAuthenticationFinished: {
            if (success)
                console.log("Authentication was successful!");
            else
                console.log("Authentication failed! reason = " + reason)
        }
    }
...

currently supported platforms: iOS