HADOOP-13580. If user is unauthorized, log "unauthorized" instead of "Invalid signed text:". Contributed by Wei-Chiu Chuang.

(cherry picked from commit f6f3a447bf)
This commit is contained in:
Wei-Chiu Chuang 2016-09-16 14:53:09 -07:00
parent 40089eadf5
commit 031d5f6c5b
1 changed files with 3 additions and 0 deletions

View File

@ -438,6 +438,9 @@ public class AuthenticationFilter implements Filter {
for (Cookie cookie : cookies) {
if (cookie.getName().equals(AuthenticatedURL.AUTH_COOKIE)) {
tokenStr = cookie.getValue();
if (tokenStr.isEmpty()) {
throw new AuthenticationException("Unauthorized access");
}
try {
tokenStr = signer.verifyAndExtract(tokenStr);
} catch (SignerException ex) {