本文介绍了创建一个OS X身份验证插件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要为OS X登录机制创建一个插件,以便我可以通过输入密码以外的其他方式来解锁屏幕.我知道这样的事情已经存在-敲门解锁或Rohos USB密钥登录就是例子.

I need to create a plugin for OS X login mechanism so that I can unlock the screen other way than by typing a password. I know things like this already exist - Knock to unlock or Rohos USB key logon are examples.

我在ADC上找到了名为"NameAndPassword"的示例代码( https://developer.apple.com/library/mac/samplecode/NameAndPassword/Introduction/Intro.html ),并经过一番挣扎()我设法在Mavericks上构建并安装了它.问题是整个插件显然有点过时了,在我输入密码后(我需要通过SSH重新启动计算机)后我也无法登录.我是xcode/objective-c的初学者,不能自己解决问题.

I found the sample code on ADC called "NameAndPassword" (https://developer.apple.com/library/mac/samplecode/NameAndPassword/Introduction/Intro.html), and after some struggle (Custom login/lock screen in OS X Mavericks) I managed to build and install it on Mavericks. The problem is that the whole plugin is apparently a little outdated and does not log me in after I type the password (I need to reboot the machine through SSH). I'm an xcode/objective-c beginner and cannot fix the problem by myself.

基本上,我的问题是:如何修改示例NameAndPassword代码,以便我可以使用键盘以外的输入登录?我想创建一个提供密码的应用程序,而不是通过键盘输入-这几乎就是我相信敲门解锁的方式.

Basically, my question is: how to modify the sample NameAndPassword code so that I could log in with input other than keyboard? I want to create an app that will provide the password, but not through keyboard - that's pretty much how I believe Knock to unlock works.

推荐答案

Apple的官方代码中有一些错误.我修补了它们,然后放在我的Github上: https://github.com/skycocker/NameAndPassword

There are some bugs in Apple's official code. I patched them and put on my Github: https://github.com/skycocker/NameAndPassword

只要您替换

<string>loginwindow:login</string>

授权策略数据库中的

带有

line in authorization policy database with

<string>NameAndPassword:invoke</string>

否则它将无法登录.

这篇关于创建一个OS X身份验证插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-30 23:11