Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you install a Mac OS X Security Auth Plugin?

I have used the NameAndPassword Auth Plugin sample code from Apple to create my own simple authentication method, but I can't find out how to install it!

I followed the details in the NullAuthPlugin sample README and the plugin appears to be in place correctly, but it doesn't work. In fact, I can't get the NameAndPassword sample app to work either.

To test, I log out (I have tried rebooting too) from Mac OS, then go to log in again. It asks for my password as usual, but then after clicking 'log-in' the screen goes blue as it would normally do for a log in, but then I am returned to the log-in screen. This loop continues every time I attempt to log-in.

Does anyone have experience with Mac OS security and can give me better details on how to correctly edit '/etc/authorization'? What is the correct format for adding the plugin to it and are there any common pitfalls with this sort of development that I might have fallen into?

I am using the code on Mac OS 10.6.6. The code builds perfectly with no errors, warnings etc.

like image 484
danpalmer Avatar asked Nov 06 '22 02:11

danpalmer


1 Answers

Likely problem: the NameAndPassword docs are old and tell you to put the bundle into the incorrect directory. Try /Library/Security/SecurityAgentPlugins/ for MacOS 10.5+

If that doesn't solve your issue, look at /var/log/debug.log for 'Login Window Started Security Agent' and see what the errors are after that.

Note that NameAndPassword does not appear to work in Lion 10.7. It's unclear to me whether or not SFAuthorizationPluginView is callable during the login process. UI-less plugins such as the NullAuthPlugin example do still work.

This Apple Tech note has a more detailed description of how to get this stuff to work, including how the policy database (/etc/authorization): http://developer.apple.com/library/mac/#technotes/tn2228/_index.html

The Auth Plugin API docs also describe how some of this works: http://developer.apple.com/library/mac/#documentation/Security/Reference/AuthorizationPluginRef/Reference/reference.html

like image 160
mirth23 Avatar answered Nov 09 '22 10:11

mirth23