Skip to content
This repository has been archived by the owner on Oct 29, 2019. It is now read-only.

Commit

Permalink
SAK-7620 Improve exception error messages when authentication fails
Browse files Browse the repository at this point in the history
git-svn-id: https://source.sakaiproject.org/svn/user/branches/sakai_2-5-x@52287 66ffb92e-73f9-0310-93c1-f5514f145a0a
  • Loading branch information
s.swinsburg@lancaster.ac.uk committed Sep 16, 2008
1 parent f86e8e6 commit 1a12312
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public Authentication authenticate(Evidence e) throws AuthenticationException
if ((evidence.getPassword() == null) || (evidence.getPassword().trim().length() == 0)
|| (evidence.getIdentifier() == null) || (evidence.getIdentifier().trim().length() == 0))
{
throw new AuthenticationException("invalid login");
throw new AuthenticationException("Invalid Login: Either identifier or password empty.");
}

// Check the cache. If repeat authentication failures are being throttled,
Expand All @@ -108,7 +108,7 @@ public Authentication authenticate(Evidence e) throws AuthenticationException
if (user == null)
{
authenticationCache().putAuthenticationFailure(evidence.getIdentifier(), evidence.getPassword());
throw new AuthenticationException("invalid login");
throw new AuthenticationException("Invalid Login: Either user not found or password incorrect.");
}

rv = new org.sakaiproject.util.Authentication(user.getId(), user.getEid());
Expand All @@ -126,7 +126,7 @@ else if (e instanceof ExternalTrustedEvidence)
// reject null or blank
if ((evidence.getIdentifier() == null) || (evidence.getIdentifier().trim().length() == 0))
{
throw new AuthenticationException("invalid login");
throw new AuthenticationException("Invalid Login: Identifier empty.");
}

// accept, so now lookup the user in our database.
Expand All @@ -141,7 +141,7 @@ else if (e instanceof ExternalTrustedEvidence)
{
// reject if the user is not defined
// TODO: create the user record here?
throw new AuthenticationException("invalid login");
throw new AuthenticationException("Invalid Login: User not found in directory.");
}
}

Expand Down

0 comments on commit 1a12312

Please sign in to comment.