![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
node-mac-auth
Advanced tools
A native node module that allows you to query and handle native macOS biometric authentication.
This module will have no effect unless there's an app bundle to own it: without one the API will simply appear not to run as a corollary of the way macOS handles native UI APIs.
Nota Bene: This module does not nor is it intended to perform process privilege escalation, e.g. allow you to authenticate as an admin user.
canPromptTouchID()
Returns Boolean
- whether or not this device has the ability to use Touch ID.
const { canPromptTouchID } = require('node-mac-auth')
const canPrompt = canPromptTouchID()
console.log(`I ${canPrompt ? 'can' : 'cannot'} prompt for TouchID!`)
NOTE: This API will return false
on macOS systems older than Sierra 10.12.2.
promptTouchID(options)
options
Object
reason
String - The reason you are asking for Touch ID authentication.reuseDuration
Number - The duration for which Touch ID authentication reuse is allowable, in seconds.Returns Promise<void>
.
const { promptTouchID } = require('node-mac-auth')
promptTouchID({ reason: 'To get consent for a Security-Gated Thing' }).then(() => {
console.log('You have successfully authenticated with Touch ID!')
}).catch(err => {
console.log('TouchID failed because: ', err)
})
NOTE: This API will have no effect on macOS systems older than Sierra 10.12.2.
To see this module in action:
$ git clone https://github.com/electron/electron-quick-start
$ cd electron-quick-start
$ npm install
$ npm install node-mac-auth
then open main.js
inside electron-quick-start
and add:
const { canPromptTouchID, promptTouchID } = require('node-mac-auth')
to the top at line 4, and
const canPrompt = canPromptTouchID()
console.log(`I ${canPrompt ? 'can' : 'cannot'} prompt for TouchID!`)
promptTouchID({ reason: 'To get consent for a Security-Gated Thing' }).then(() => {
console.log('You have successfully authenticated with Touch ID!')
}).catch(err => {
console.log('TouchID failed because: ', err)
})
Inside the createWindow
function beginning at line 9. Enjoy!
FAQs
Query and handle native macOS biometric authentication.
The npm package node-mac-auth receives a total of 5 weekly downloads. As such, node-mac-auth popularity was classified as not popular.
We found that node-mac-auth demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.