-
Notifications
You must be signed in to change notification settings - Fork 16.2k
feat: add Touch ID authentication support for macOS #16707
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
bb3dec9
to
3273849
Compare
@@ -93,6 +93,8 @@ void SystemPreferences::BuildPrototype( | |||
.SetMethod("setAppLevelAppearance", | |||
&SystemPreferences::SetAppLevelAppearance) | |||
.SetMethod("getSystemColor", &SystemPreferences::GetSystemColor) | |||
.SetMethod("isTouchIDAvailable", &SystemPreferences::IsTouchIDAvailable) | |||
.SetMethod("promptTouchID", &SystemPreferences::PromptTouchID) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is SystemPreferences the right place for this functionality? It doesn't seem preference-related.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i thought about this too, but wasn't sure there was any more appropriate place 🤔
On Mac, this is where one would modify and deal with settings for TouchID though, so i think it's best of our available options
1d51efc
to
679f72a
Compare
f4f653c
to
c6bbe88
Compare
Clarify how `systemPreferences.canPromptTouchID()` and `systemPreferences.promptTouchID()` behave on older versions of macOS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for all the fixes! LGTM
I gotta forward-declare the instance method update: 🍐'd through it |
Release Notes Persisted
|
I have automatically backported this PR to "5-0-x", please check out #16952 |
Was this eventually removed from 5.0x? It doesn't look like systemPreferences module has these methods anymore. And they are also missing in the documentation |
@alchaplinsky this was never backported to 5; it's only present in 6 onward. Online documentation reflects the latest stable version (5-0-x) so that's why it's not present there either. |
@codebytere Ok, got it. Thank you for response. Will try out v6. |
How does one “set Access Control Constants like kSecAccessControlUserPresence on their keychain entry”? |
Description of Change
Resolves #16699.
This PR adds Touch ID authentication support for macOS with two new
SystemPreferences
methods.systemPreferences.promptForTouchID()
returns a Promise that resolves withtrue
if successful and rejects with an error message if authentication could not be completed.systemPreferences.isTouchIDAvailable()
returns a Boolean that'strue
if this device is a Mac running a supported OS that has the necessary hardware for Touch ID andfalse
otherwise.Checklist
npm test
passesRelease Notes
Notes: Added native Touch ID authentication support for macOS.