Skip to content

Commit

Permalink
fix for OvationException instead of UserAuthenticationException for l…
Browse files Browse the repository at this point in the history
…ogin failure and returning AUTHENTICATE challenge response for all auth failures (instead of FORBIDDEN)
  • Loading branch information
ronreynolds committed Feb 6, 2012
1 parent 402091e commit 7d61c23
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/ovation/odata/service/JerseyAuthenticator.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,13 @@ public Result authenticate(HttpExchange xchng) {
return new Authenticator.Success(new HttpPrincipal(userName, "ovodata"));
}
} catch (UserAuthenticationException uax) {
_log.warn("failed to authenticate '" + userName + "'");
} catch (OvationException ox) {
// FIXME - special-case for change in auth failure in DataContext.authenticateUser()
if ("Incorrect password".equals(ox.getMessage()) == false) {
throw ox;
}
}
_log.info("failed to authenticate user '" + userName + "'");
return new Authenticator.Failure(Response.Status.FORBIDDEN.getStatusCode());
} catch (IllegalArgumentException iax) {
_log.error(iax.toString());
}
Expand Down

0 comments on commit 7d61c23

Please sign in to comment.