I am using a solution from @CarlosP in my objective C app to execute a script as administrator.
Link is above but basically it's doing this:
NSDictionary *errorInfo = [NSDictionary new];
NSString *script = [NSString stringWithFormat:@"do shell script \"%@\" with administrator privileges", fullScript];
NSAppleScript *appleScript = [[NSAppleScript new] initWithSource:script];
NSAppleEventDescriptor * eventResult = [appleScript executeAndReturnError:&errorInfo];
It works great, but it doesn't enable/allow Touch ID. Is there a way for me to do that within the scope of NSAppleScript?
You can enable Touch ID authorization for sudo. Check details here and here.
Add
auth sufficient pam_tid.soto/etc/pam.d/sudofile. In you Applescript removewith administrator privilegesand usesudoin your shell script.