Git Product home page Git Product logo

tidcli's Introduction

Outrageously simple touch ID command line prompter

Touch ID Command Line Interface (tidcli) simply pops a Touch ID prompt.

It returns an exit code of 0 on success and 1 on failure.

You can use this to embed additional authentication steps into your shell script or the like.

image

Usage

tidcli [optional prompt context]

Optional custom prompt information can be passed as the first argument. This is limited to 100 characters.

An example of using it in a bash shell script to exit if there is an authentication failure is:

tidcli "EXAMPLE SCRIPT"
if [[ "$?" -ne 0 ]]; then
  exit 1
fi

Installing

Download the appropriate binary from the releases page.

Building

Build a release binary with swift by running:

swift build -c release

The resulting binary will be in the .build/release directory as tidcli.

Notes

Password fallback not allowed

The Touch ID prompt will contain a "Use Password" button, but only biometric authentication is allowed, so clicking it will result in an authentication failure. If you wanted to change this you could use .deviceOwnerAuthentication instead of .deviceOwnerAuthenticationWithBiometrics.

Output on standard error

Success and failure messages are output to standard error.

Sandbox Execution

A macOS sandbox profile is included if you're so inclined. You can execute it with sandbox-exec and just need to pass the full path of where the binary is located. For example:

sandbox-exec -D_PWD="$PWD/tidcli" -f tidcli.sb tidcli

tidcli's People

Contributors

singe 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.