diff --git a/src/main/java/com/letterpaw/soap/util/Auth.java b/src/main/java/com/letterpaw/soap/util/Auth.java index 50ab18be0f68c6529701af35d229d5012b4dee40..15a06153cdee97466e85c50d761c274e3e6d36e5 100644 --- a/src/main/java/com/letterpaw/soap/util/Auth.java +++ b/src/main/java/com/letterpaw/soap/util/Auth.java @@ -17,10 +17,11 @@ public class Auth { public static boolean IsAuthenticated(WebServiceContext ctx, ServiceType type) { @SuppressWarnings("unchecked") // Check the request with the API Key - // Check if the service is authenticated or not, message context is used to get HTTP request headers, which contains the key, + // Check if the service is authenticated or not, message context is used to get + // HTTP request headers, which contains the key, // which is then compared with the actual key - Map<String, List<String>> headers = (Map<String, List<String>>) - ctx.getMessageContext().get(MessageContext.HTTP_REQUEST_HEADERS); + Map<String, List<String>> headers = (Map<String, List<String>>) ctx.getMessageContext() + .get(MessageContext.HTTP_REQUEST_HEADERS); // Get header for authorization List<String> auth = headers.get("authorization"); String key = ""; @@ -30,10 +31,10 @@ public class Auth { } else if (type == ServiceType.PHP) { key = PHPAPIKey; } - System.out.println(auth.get(0)); - System.out.println(key); - System.out.println(!auth.isEmpty() && auth.get(0).equals("Bearer " + key)); -// return true; + // System.out.println(auth.get(0)); + // System.out.println(key); + // System.out.println(!auth.isEmpty() && auth.get(0).equals("Bearer " + key)); + // return true; // Check the key validity return !auth.isEmpty() && auth.get(0).equals("Bearer " + key); }