I am developing a Mac application. Within this application, I need to execute certain commands and expressions with root privilege access. I am working to perform this action, and once authenticated, it should persist throughout the entire app lifecycle. Similar to allowing keychain access for Xcode applications by selecting the 'Always allow' permission.
Please let me know:
1. Is it possible for a third-party application to exhibit such behavior?
2. If it is possible, what type of permissions do I need to set?
3. Do I need any specific entitlements for this?
Thank you for your insights and assistance. Your responses are highly valued, and any guidance you can provide will be greatly appreciated.
Post
Replies
Boosts
Views
Activity
I need to achieve the following behaviour in my App
When the app is run for the first time, prompt the user to authenticate by entering their administrative password.
Upon successful authentication, securely store the administrative password using macOS Keychain Access.
For subsequent executions of the same command, retrieve the stored password from the Keychain and use it to execute the privileged command without requiring the user to enter the administrative password again.
By implementing this approach, users will only need to authenticate once, and subsequent executions of the privileged command will be seamless without further authentication prompts.
Let me know is it required any specific entitlement? How can we achieve this?