diff options
author | Jorge Hernandez <jorge.hernandez-herrero@att.com> | 2019-04-03 02:01:34 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-04-03 02:01:34 +0000 |
commit | d5f95d08ffd3f2e16b67aadae7007c7a51dfae19 (patch) | |
tree | a9388d004af2bf679b66524edbc53571ce06d8e1 /ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/restAuth/AuthenticationService.java | |
parent | 338796c4d56d2e95aa2903d80589b3b35b5a3dd2 (diff) | |
parent | c1b69dfb1297365d35f2ada8690f13f787d38b4f (diff) |
Merge "Enhancement to use the common CryptoUtils"
Diffstat (limited to 'ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/restAuth/AuthenticationService.java')
-rw-r--r-- | ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/restAuth/AuthenticationService.java | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/restAuth/AuthenticationService.java b/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/restAuth/AuthenticationService.java index 0d066c59c..b1b092431 100644 --- a/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/restAuth/AuthenticationService.java +++ b/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/restAuth/AuthenticationService.java @@ -2,14 +2,14 @@ * ============LICENSE_START======================================================= * ONAP-PDP-REST * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017,2019 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -20,25 +20,23 @@ package org.onap.policy.pdp.rest.restAuth; +import com.att.research.xacml.util.XACMLProperties; import java.util.Base64; import java.util.StringTokenizer; - -import org.onap.policy.rest.XACMLRestProperties; - -import com.att.research.xacml.util.XACMLProperties; - import org.onap.policy.common.logging.eelf.MessageCodes; import org.onap.policy.common.logging.eelf.PolicyLogger; +import org.onap.policy.rest.XACMLRestProperties; +import org.onap.policy.utils.PeCryptoUtils; public class AuthenticationService { private String pdpID = XACMLProperties.getProperty(XACMLRestProperties.PROP_PDP_USERID); - private String pdpPass = XACMLProperties.getProperty(XACMLRestProperties.PROP_PDP_PASS); - + private String pdpPass = PeCryptoUtils.decrypt(XACMLProperties.getProperty(XACMLRestProperties.PROP_PDP_PASS)); + public boolean authenticate(String authCredentials) { if (null == authCredentials) return false; - // header value format will be "Basic encodedstring" for Basic authentication. + // header value format will be "Basic encodedstring" for Basic authentication. final String encodedUserPassword = authCredentials.replaceFirst("Basic" + " ", ""); String usernameAndPassword = null; try { @@ -58,5 +56,5 @@ public class AuthenticationService { return false; } } - + } |