The login window application is defined as part of the startup configuration in /System/Library/LaunchDaemons/com.apple.loginwindow.plist.
In theory, you can replace the login window with your own, but I donβt know what you need to do in the new application - I think that the login window is a little more than authentication, and setting up a user session β among others, it looks like he performs some running tasks.
I have compiled an application that calls CGSCreateLoginSession, and after launching it, it goes to the login window through a rotating cube. I assume that this requires CoreGraphics - it's just a graphical function that causes a logout at the end.
You can try the InputManager and see that the login window loads the code -> if so, you can change the username NIB (LoginWindowUI.nib) loginwindow and add some buttons to display a new window using the user's browser. Once the student selects a photo for himself, you can autofill the username and password fields in the loginwindow window.
Node is all a theory, and it looks very fragile and insecure.
Good luck.
Edit later
Please note that this is very unsafe, so use with caution - I tried my system a couple of times when I tested this material
It implements a proof of concept concept that introduces code into loginwindow.
#include <stdio.h> #include <unistd.h> #include <sys/time.h> #include <strings.h> #include <syslog.h> #import <Cocoa/Cocoa.h> #include <execinfo.h> @interface LLApp:NSApplication @end @implementation LLApp - (void)run { syslog(LOG_ERR, "LLApp being run"); [super run]; } @end void my_openlog(const char *ident, int logopt, int facility); typedef struct interpose_s { void * new_func; void * orig_func; } interpose_t; int MyNSApplicationMain(int argc, const char ** argv); static const interpose_t interposers[] __attribute__ ((section("__DATA, __interpose"))) = { { (void *) my_openlog, (void *) openlog }, }; void my_openlog(const char *ident, int logopt, int facility) { openlog(ident, logopt, facility); if(!strcmp(ident, "/System/Library/CoreServices/loginwindow.app/Contents/MacOS/loginwindow")) { [LLApp poseAsClass:[NSApplication class]]; } else { syslog(LOG_ERR, "Ignoring unknown indent: >%s<", ident); } return; }
The code is compiled with:
gcc -Wall -dynamiclib -undefined dynamic_lookup -o ~/Desktop/libinterposers.dylib testin.m -framework Cocoa
The code loading is based on intermediate allocation, therefore, the startd loginwindow definition must contain an additional record (to enable intermediate allocation in the dynamic linker), that is:
<key>EnvironmentVariables</key> <dict> <key>DYLD_INSERT_LIBRARIES</key> <string>path_to/Desktop/libinterposers.dylib</string> </dict>