X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=ECOMP-PDP-REST%2Fsrc%2Fmain%2Fjava%2Forg%2Fopenecomp%2Fpolicy%2Fpdp%2Frest%2Fconfig%2FPDPApiAuth.java;h=c4573cc0d0a7f0a6a9364a1661486444154513e2;hb=fc5c07705edc4dcb7083b39116a43844bb6a1490;hp=e6122d324c73c85cc221ae8b6d9502e119d8316d;hpb=87c95be02a8a4d77e165dede90777e811b59dcae;p=policy%2Fengine.git diff --git a/ECOMP-PDP-REST/src/main/java/org/openecomp/policy/pdp/rest/config/PDPApiAuth.java b/ECOMP-PDP-REST/src/main/java/org/openecomp/policy/pdp/rest/config/PDPApiAuth.java index e6122d324..c4573cc0d 100644 --- a/ECOMP-PDP-REST/src/main/java/org/openecomp/policy/pdp/rest/config/PDPApiAuth.java +++ b/ECOMP-PDP-REST/src/main/java/org/openecomp/policy/pdp/rest/config/PDPApiAuth.java @@ -51,6 +51,10 @@ public class PDPApiAuth { private static Long oldModified = null; private static AAFPolicyClient aafClient = null; + private PDPApiAuth(){ + // Private Constructor + } + /* * Set Property by reading the properties File. */ @@ -84,14 +88,14 @@ public class PDPApiAuth { String resource) { try{ String[] userNamePass = PolicyUtils.decodeBasicEncoding(clientEncoding); - if(userNamePass==null){ + if(userNamePass==null || userNamePass.length==0){ String usernameAndPassword = null; byte[] decodedBytes = Base64.getDecoder().decode(clientEncoding); usernameAndPassword = new String(decodedBytes, "UTF-8"); StringTokenizer tokenizer = new StringTokenizer(usernameAndPassword, ":"); String username = tokenizer.nextToken(); String password = tokenizer.nextToken(); - userNamePass= new String[]{username, password}; + userNamePass= new String[]{username, password}; } PolicyLogger.info("User " + userNamePass[0] + " is Accessing Policy Engine API."); Boolean result = false;