sergiogonzalez/liferay-portal — pull request #424 by matethurzo (2012-11-02 14:08:09+00:00)
Title: LPS-30678 AutoLogin changes

Hey Sergio,

So as we discussed I dug deeper in the AutoLogin topic, and here is what I've found, and what I've changed.

- in several cases I've changed the AutoLogins to return null, instead of returning with the credential initialized with null. The reason for this is I think it's more easy to see what's going on. The null return value will be handled properly in the caller AutoLoginFilter class so it's no harm.
- In the cases where we can throw an Exception I've unified the AutoLogins to wrap the exception caught in there and throw an AutoLoginException. The cases we can not throw an exception is when we use the AUTO_LOGIN_REDIRECT because the AutoLoginFilter will try to parse it no matter if we successfully logged in a user or not.
- I've removed the logging from several AutoLogin classes because it really was just logging the exception and nothing more. but with the new AutoLoginException it will still be logged but one level outer in the AutoLoginFilter.
- I've changed the AutoLoginFilter's logging slightly. Previously it could log multiple errors to the log, because in certain cases the exception was written twice there. I've simplified that logging statement, and made it a warn. The reason for this is the portal won't die if an auto login cannot log the user in, it's just a warning. I mean the portal is still functional, the result will be of course the user is not logged in but it's not like the portal is unusable. So a warn is just enough there. If a customer wants to see the warn then he or she can add a warn level config just for the AutoLoginFilter only.

Thanks,

Máté