1

The Knock app lets you knock on your iPhone to unlock your Mac.

I come from the iOS side and was naturally surprised to see it was able to modify the lock screen. How does it do that? Can any Mac OS X just do anything it wants to the lock screen?


(source: heavy.com)

Also, while installing, the password prompt seemed... unusual. It wasn't like the default password prompt, but more like the one on the lock screen:


(source: mshcdn.com)

Any idea about what's going on?

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
Jaka Jančar
  • 11,386
  • 9
  • 53
  • 74

1 Answers1

2

OSX has a security system that allows third party developers to develop authorisation plugins, in order to provide alternative or additional security, such as finger print scanners, iris readers or anything else you want to provide.

There's a database of rules which states for each type of security access, what security mechanisms are used. You can see this in action when you see the padlock icon in Security Preferences. Clicking on a locked icon brings up a security dialog asking for credentials.

The lock screen and login uses the same mechanism, so with this in mind, it's not too difficult to write a plugin which listens out for a network message (in this case, via bluetooth) from the iPhone, which is sent when the internal gyroscope picks up the knock.

Modifying the security rules database allows the developer to switch the standard login dialog for their security plugin and that's all there is to it.

As for being more secure, I'm not too sure about that; they are, after all, replacing the standard OSX security, which requires a password that is verified through Apple's cryptography.

If someone in your home picked up your iPhone, they can easily knock on it and unlock your Mac, but with a password, only you should know that!

TheDarkKnight
  • 27,181
  • 6
  • 55
  • 85
  • Do you know if this API is documented somewhere? – cansik Jan 10 '14 at 14:47
  • Apple's documentation for the Authorization plugin can be found here: https://developer.apple.com/library/mac/documentation/security/Reference/AuthorizationPluginRef/Reference/reference.html – TheDarkKnight Jan 13 '14 at 08:45
  • Yes, I opened a new question about this because Apple doesn't provide actual documentations: http://stackoverflow.com/questions/21056322/customize-login-screen-mac-osx-sfauthorizationpluginview – cansik Jan 13 '14 at 11:48
  • Knock To Unlock doesn't add anything to the security rules database. They are doing it another way, which is yet unknown to me. – Yarneo Nov 27 '14 at 18:11