Move CAS authentication code out of the login activity