Removed nullpointer when authenticate() got AuthenticationException.