There are only 161 lines of code in app_authenticate.c (excluding the documentation, but including other comments and blank lines). None of them manipulates channel variables.
Hi wouldnt take much to use Read() and the Astdb to make a authentication system that will set variables and report wrong passwords, We use this method for accessing conference rooms.