Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating an OS X authentication plugin

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.

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.

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.

like image 857
Michał Siwek Avatar asked Feb 12 '14 19:02

Michał Siwek


People also ask

What is an authorization plugin?

An authorization plugin approves or denies requests to the Docker daemon based on both the current authentication context and the command context. The authentication context contains all user details and the authentication method. The command context contains all the relevant request data.

How do I authorize a Mac plugin?

It's easy to allow the installation:Hold down the Control key and click on the application. In the menu that pops up, click "Open." A window will pop up asking you to confirm. Click "Open."

Can you get Active Directory on Mac?

You can use the Active Directory connector (in the Services pane of Directory Utility) to configure your Mac to access basic user account information in an Active Directory domain of a Windows 2000 or later server.


Video Answer


1 Answers

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

This version of the plugin should work fine, as long as you replace

<string>loginwindow:login</string>

line in authorization policy database with

<string>NameAndPassword:invoke</string> 

Otherwise it won't log you in.

like image 97
Michał Siwek Avatar answered Oct 19 '22 22:10

Michał Siwek