Fixed #164: The authentication was implemented passing throughout a managed bean because Glassfish 4 had a bug related to the form-based authentication. Since we have migrated everything to WildFly and it doesn't have this bug, I took the opportunity to write back the original authentication implementation.