开发者

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 sc开发者_如何学Creen. 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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜