1. Is there a way to get AuthorizationCreate
to display the
authentication dialog with Touch ID? I see LocalAuthentation can
display a TouchID dialog.
No.
This isn’t a technical issue but a policy choice [1]. The code that displays the authentication alert only shows the Touch ID option for Apple clients.
2. Is there (apart from AppleScript) a non-deprecated way to simply
request authorization, launch a helper with privileges and arguments,
then easily obtain the results from it?
No.
Having said that, I don’t consider the AppleScript approach (do shell script … with administrator privileges
) to be a valid alternative to the long-deprecated AuthorizationExecuteWithPrivileges
(AEWP). I view the AppleScript facility as equivalent to sudo
: It’s intended to be used by system administrators, and not as API. If we could deprecate the AppleScript approach in the context of an app running an AppleScript, we would.
3. I get the impression that with SMJobBless
(a non-deprecated API,
but a ton of work), the helper will then permanently have escalated
privileges, surely this is less secure?
That depends on how you look at it. The problem with AEWP is that there’s no secure link between the code asking to elevate privileges and the code that’s run with elevated privileges. SMJobBless
fixes that.
However, its design, where the privileged helper tool retains its privileges, certainly engenders some security risks. You must write that code securely.
4. Also with SMJobBless
, it appears that I need to use an installer
package to install the helper in the correct place, is this correct?
No. The point of SMJobBless
is that you can avoid the installer package.
If you already have an installer package in play, there’s no need for SMJobBless
. The package can install a launchd
daemon directly.
5. Is there a replacement for SMJobSubmit
in the works?
I can’t talk about The Future™. However, given that it was deprecated almost 8 years ago and there’s been no movement since then, I wouldn’t hold your breath.
As always, if you have specific requirements in this space, I encourage you to file an enhancement request describing them.
6. What am I missing, or misunderstanding?
It’s hard to say without more context. Most notably, why are you escalating privileges in the first place?
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
[1] And don’t ask me to explain policy or I’ll start to whimper (-: