Class DefaultAuthenticationService

    • Field Detail

      • LOGIN_ANONYMOUS_ALWAYS_DISABLED

        public static final java.lang.String LOGIN_ANONYMOUS_ALWAYS_DISABLED
        Configuration constant for login.anonymous.always.disabled/ which allows changing the (default) disabling of the anonymous account.
        See Also:
        Constant Field Values
    • Constructor Detail

      • DefaultAuthenticationService

        public DefaultAuthenticationService()
    • Method Detail

      • login

        public UserModel login​(java.lang.String login,
                               java.lang.String password)
                        throws InvalidCredentialsException
        Description copied from interface: AuthenticationService
        login the user identified with login and password. login means the credentials are checked and the user is being set as current user on the session (see UserService.setCurrentUser(UserModel)) Implementation note: The default implementation checks against the Jalo user UID and the password.
        Specified by:
        login in interface AuthenticationService
        Parameters:
        login - the login
        password - the password
        Returns:
        the same usermodel that is also set as current user in the session
        Throws:
        InvalidCredentialsException - if username/login does not match
      • buildInvalidCredentialsException

        protected InvalidCredentialsException buildInvalidCredentialsException()
        for security reasons we should throw same exception for both cases:
      • user not found
      • password does not match You can overwrite this method and adapt the exception and/or test that should be thrown in this case
Returns:
InvalidCredentialsException
  • buildInvalidCredentialsException

    protected InvalidCredentialsException buildInvalidCredentialsException​(java.lang.String message)
  • setUserService

    public void setUserService​(UserService userService)
  • setPasswordEncoderService

    public void setPasswordEncoderService​(PasswordEncoderService passwordEncoderService)