#StackBounty: #macos #authentication API to check whether OS X device is protected with the password

Bounty: 50

I am looking for an API to check whether macBook is protected with a password.

I am aware of similar API on iOS:

 LAContext *laContext = [[LAContext alloc] init];
 BOOL passcodeSet = [laContext canEvaluatePolicy:LAPolicyDeviceOwnerAuthentication error: &authError];

Unfortunately, this always returns true when you set a password to empty and/or turn on auto-login. I checked with Apple and it’s expected behavior.

Is there any other API which allows to get password status (directly or indirectly)?

Update 1

It looks like I am using a little bit improper terminology. I am trying to check whether the user account is protected by password (rather whole mac is protected by password). However, that being said it’s almost the same thing for a majority of end-users who own macOS device and have just one active account on it.

Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.