Bypass loginwindow at login using auth plugin

Hi.

I want to implement automatic login on my mac. I had figured I would be able to achieve that if I were to implement an auth plugin that would set the username and password context values before loginwindow:login mechanism runs. I thought this would work as the NameAndPassword example provided by Apple sets only these two values and all other login context is gathered when builtin:authenticate mechanism runs.

So I created a custom auth plugin 'customPlugin' which simply sets the context values 'username' and 'password' to my credentials and placed it before loginwindow:login in system.login.console rule.
Code Block
<array>
<string>builtin:policy-banner</string>
<string>customPlugin:setCreds</string>
<string>loginwindow:login</string>
<string>builtin:login-begin</string>
<string>builtin:reset-password,privileged</string>
<string>builtin:forward-login,privileged</string>
<string>builtin:auto-login,privileged</string>
<string>builtin:authenticate,privileged</string>
<string>PKINITMechanism:auth,privileged</string>
<string>builtin:login-success</string>
<string>loginwindow:success</string>
<string>loginwindow:FDESupport,privileged</string>
<string>HomeDirMechanism:login,privileged</string>
<string>HomeDirMechanism:status</string>
<string>MCXMechanism:login</string>
<string>CryptoTokenKit:login</string>
<string>loginwindow:done</string>
</array>

The custom auth plugin works as expected and the context values are set. But instead of logging me in without displaying the login window as I had expected, I still see the login window and control doesn't pass down to builtin:login-begin mechanism until I've selected a user and input password on the login window.

Is there something else I need to be doing to achieve an automatic login where I wouldn't need to interact with the login window at all?


Bypass loginwindow at login using auth plugin
 
 
Q