Basically each system user may have a different environment setup and
we would like to chose to which one to login.
I suspect it’ll be easier to have a single user and write code to switch that user’s environment. However, I see two other ways you might achieve your goal.
Screen Sharing works in the pre-login environment and you can configure it to support a standard protocol (VNC). You could write a VNC client that logs the user in that way.
You could implement an authorisation plug-in. At boot time the system acquires the system.login.console authorisation right, and it’s the mechanisms array in that right specific that drives the login process:
% security authorizationdb read system.login.console
…
<dict>
<key>class</key>
<string>evaluate-mechanisms</string>
…
<key>mechanisms</key>
<array>
<string>builtin:prelogin</string>
<string>builtin:policy-banner</string>
<string>loginwindow:login</string>
<string>builtin:login-begin</string>
<string>builtin:reset-password,privileged</string>
<string>loginwindow:FDESupport,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>HomeDirMechanism:login,privileged</string>
<string>HomeDirMechanism:status</string>
<string>MCXMechanism:login</string>
<string>CryptoTokenKit:login</string>
<string>loginwindow:done</string>
</array>
…
</dict>
</plist>
YES (0)
The loginwindow:login mechanism actually displays the UI. You could replace that with your own mechanism that gets the user name and password from somewhere other than the user.
IMPORTANT Writing an authorisation plug-in is really challenging. If you decide to go down this path, ping me via email.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"