How to login on Macbook with an App

Hi! I'm from Argentina, my english is so bad, i'm sorry for that. I'm new in apple development, and I want to make an app on OS X for login on de laptop without put my password (For example: facial recognition, or with the iPhone directly). I'm looking for an API or something that help me to introduce the password automatically in the mac. The language is Swift.


P/D: I'm not sure if this is the correct topic for my doubt.


Again, I'm sorry for my english. Regards.

From your comments I think what you want is an Authorization Plug-in (See Technical Note TN2228 "Running At Login" for details) rather than an application. An Authorization Plug-in is Apple's recommended approach for running code that's coordinated with the login process (i.e. the Login Window).

Hi! Thank you so much for your answer. Okay, I look that and I don't know if that help me. I want to know if there is some kind of permission to unlock the mackbook directly, without entering on the system authentication. Something like Knock app for iPhone. Do you understand?


Thank you.

mdobro is on the right track here. If, for example, you want to allow the user to log into the machine using facial recognition, you’ll need an authorisation plug-in that replaces the built-in login mechanisms referenced by the

system.login.console
right in the authorisation database. Your plug-in can then display its own UI to authenticate in whatever way it sees fit.

The only gotcha here is the the system needs to know the user’s password in order to unlock the keychain. Your authorisation plug-in will need to provide that password (via the authorisation context) if you want the keychain to be unlocked as part of the login process.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Thank you for your answer skimo, my idea is login on the MacBook after awake from the sleep (no shutdown). It is really necessary the authentication plug-in? Or the only way is that?

The only way to plug in to wake-from-sleep authentication is via an authorisation plug-in. This is like initial login, except there's a different right,

system.login.screensaver
. The default definition of that has changed over the years. On modern systems (at least on 10.11.x, where I checked) it has a default definition that’s very much hard-wired. I believe you can change it to use a mechanisms array, much like
system.login.console
, but I’m not really an expert in this aspect of authorisation plug-ins.

If you need expert advice on this I recommend that you open a DTS tech support incident so you can talk with the guy in DTS who supports this officially.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"
How to login on Macbook with an App
 
 
Q