Custom Login / Lock Screen in OS X Mavericks

I'm trying to override the default login / lock screen in OS X to allow the user to log in differently than providing a password (think about fingerprint scanning or how “Knock to unlock” works), and I'm looking to do it in a few hours - everything that I found looks useful, this is the ADC link of the authorization plugin and this example: https://developer.apple.com/library/mac/samplecode/NameAndPassword/Introduction/Intro.html#/ / apple_ref / doc / uid / DTS10004022

This xCode NameAndPassword project is a bit outdated, but I just managed to create it by specifying the base SDK (there was an incorrect path with hard code), then I put the resulting .bundle file in the /Library/Security/SecurityAgentPlugins directory. Nothing has changed after I locked my screen, but I know that I need to add the authorization role to the /etc/authorization file, which, as I know, no longer exists in Mavericks (there is this auth.db file and all auth API) m is therefore stuck here - I don't know how to put NameAndPassword inside this database.

Please let me know how to do this correctly, or if you know some other way to achieve my goal.

+5
xcode osx-mavericks macos
source share
1 answer

I found a way to edit the database - at first I tried direct changes to /var/private/db/auth.db sqlite, but this did not work, so after a while I managed to make it easier than I thought:

  • security authorizationdb read system.login.console > outfile.plist

  • After that, you need to modify the resulting outfile.plist , as it said in the NullAuthPlugin file:

     <key>mechanisms</key> <array> <string>NameAndPassword:invoke</string> 

    (the last line is the one to be added to the file).

  • Then, to save it to the database:

    security authorizationdb write system.login.console < outfile.plist

Then the changes should be visible on any login / lock screen of your system, but be careful!

You cannot authenticate with the current version of the NameAndPassword example!

Be sure to set up a working SSH connection on Mac before that you are modifying in the database, so you can undo the changes using another device (just repeat the db modification process, but this time delete the one you added earlier).

+10
source share

All Articles