security authorize

Authorize requested right(s).

Syntax
      authorize [-updPiew] [right...]
          
          The extend-rights flag will be passed by default.

Options
   -u   Allow user interaction.
   -p   Allow returning partial rights.
   -d   Destroy acquired rights.
   -P   Pre-authorize rights only.
   -l   Operate authorization in least privileged mode.
   -i   Internalize authref passed on stdin.
   -e   Externalize authref to stdout
   -w   Wait while holding AuthorizationRef until stdout is closed. This will allow client
        to read externalized AuthorizationRef from pipe.

Examples

Basic authorization of my-right:

security> security authorize -ud my-right

Authorize a right and pass it to another command as a way to add authorization to shell scripts:

security> security -q authorize -uew my-right | security -q authorize -i my-right

“Security is mostly a superstition. It does not exist in nature, nor do the children of men as a whole experience it. Avoiding danger is no safer in the long run than outright exposure. Life is either a daring adventure, or nothing” ~ Helen Keller

Related macOS commands

Local man page: security - Command line help page on your local machine.
How-to: security - Administer Keychains, keys, certificates and the Security framework.


 
Copyright © 1999-2025 windevcluster.com
Some rights reserved