Uploaded image for project: 'Crowd Data Center'
  1. Crowd Data Center
  2. CWD-2375

CrowdService#authenticate should throw a subclass of FailedAuthenticationException

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Fixed
    • 2.2.4
    • Embedded
    • None
    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

    Description

      Introduce a new exception called AccountNotFoundException that is a subclass of FailedAuthenticationException when the user cannot be found in CrowdService#authenticate. CrowdService#authenticate will no longer throw the runtime UserNotFoundException.

      The reason for this change is that before Crowd 2.2.2, when a user is not found, a FailedAuthenticationException (which is a checked exception) would be thrown - which is the correct behaviour. Since Crowd 2.2.2 however, we throw a UserNotFoundException. The reason for this change is actually due to the fact that we want ApplicationService#authenticate to throw a UserNotFoundException so that we can ignore it and attempt authentication with other directories. We don't want to stop an authentication just because a directory does not contain the user.

      The problem with throwing a UserNotFoundException is that every client code calling CrowdService#authenticate will need to now also catch a UserNotFoundException, when they generally don't care.

      The above solution allows client code which cares about distinguishing the types of FailedAuthenticationException to do so, which keeping client code minimal.

      Attachments

        Activity

          People

            Unassigned Unassigned
            4c7409f97ecf James Wong
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 2h
                2h
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 1.5h Time Not Required
                1.5h