Giter Site home page Giter Site logo

eaceto / localauthentication-verify Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 25 KB

A CLI tool to verify user's credential using Biometry, Watch or Password. Useful for other other apps wanting to use Local Authentication as a unlock method.

License: GNU General Public License v3.0

Swift 100.00%
localauthentication apple security macos macosx macos-app biometry fingerprint fingerprint-authentication touchid touchid-authentication

localauthentication-verify's Introduction

LocalAuthentication Verify

A CLI tool to verify user's credential using Biometry, Watch or Password. Useful for other other apps wanting to use Local Authentication as a unlock method.

Installation

brew update brew install eaceto/macos-tools/Localauthenticationverify

Usage

$ la-verify [arguments]

Arguments

  • -s, --supports [policy] Check if the policy is supported in this device (empty policy refears to deviceOwnerAuthentication)
  • -a, --authenticated [policy] Authenticate using policy (empty policy refears to deviceOwnerAuthentication)

Where policy is a LocalAuthentication Policy

Policies and arguments mapping

The policy argument in this tool can take 4 values, each of them refers to an LocalAuthentication Policy as defined in Apple docs

  • withBiometrics -> LAPolicy.deviceOwnerAuthenticationWithBiometrics
  • withWatch -> LAPolicy.deviceOwnerAuthenticationWithWatch
  • withBiometricsOrWatch -> LAPolicy.deviceOwnerAuthenticationWithBiometricsOrWatch
  • (empty) -> LAPolicy.deviceOwnerAuthentication

For example, if you need to check if authentication with Watch is possible, you can execute

$ la-verify -s withWatch

Which can produce either of the following responses

Unsupported: No AppleWatch was discovered.
Supported

Output and Status Code

All successful outputs (supports or authenticate) will produce an exit code: 0 indicating success. And all outputs with errors will produce an exit code: 1 indicating failure. By doing this, you don't need to parse the output string, just check the status code.

$ ./la-verify -s withWatch
Unsupported: No AppleWatch was discovered.
$ echo $?
1
$ ./la-verify -a          
Authenticated
$ echo $?
0

References

localauthentication-verify's People

Contributors

eaceto avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.