From 896817f2d183dd260609a774ed9db222894f8cbd Mon Sep 17 00:00:00 2001 From: Brad Klein Date: Mon, 18 Apr 2016 13:42:11 -0600 Subject: [PATCH] Log the end of the token which varies by token Turns out the beginning of the token is largely the same and not very meaningful in a log. Instead log the end of the token which should be different between legitimate tokens. Change-Id: I805965cc67d75ec975d2d26951fa9396e5397ede --- .../main/java/monasca/common/middleware/HttpAuthClient.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/java/monasca-common-middleware/src/main/java/monasca/common/middleware/HttpAuthClient.java b/java/monasca-common-middleware/src/main/java/monasca/common/middleware/HttpAuthClient.java index 6cdc948c..03c24359 100644 --- a/java/monasca-common-middleware/src/main/java/monasca/common/middleware/HttpAuthClient.java +++ b/java/monasca-common-middleware/src/main/java/monasca/common/middleware/HttpAuthClient.java @@ -101,10 +101,10 @@ public class HttpAuthClient implements AuthClient { instream = entity.getContent(); instream.close(); // - // Don't log the whole token, just the first ten characters + // Don't log the whole token, just the last ten characters // - throw new AuthException("Authorization failed for user token beginning with: " - + token.substring(0, 10)); + throw new AuthException("Authorization failed for user token ending with: " + + token.substring(token.length() - 10)); } if (code != 200) {