Login form with Extbase and rsa_auth / salted_passwords

Implementing a login form in TYPO3 is somehow rather easy. You just put up a form, send username and password to any page with certain names for the input fields and basically you are done.

Things become more complicated when you start using rsa_auth and salted passwords. For my project, this was a requirement so I started investigating how rsa_auth hooks into fe_login and reimplemented the mechanism using Extbase.

As rsa_auth provides some additional information whenever a user tries to log in, first of all, we have to get those values and some lines of JavaScript into our login form. I therefore implemented my own LoginController and added an Action "showLoginForm":

So what's happening here? We can register some hooks that provide additional hidden fields and onSubmit actions for our login forms. rsa_auth offers one of these hooks which we collect in our for-loop. After that those values are passed to our login form template: