Merge "SSL_BASIC getting 403 error"
authorJames Forsyth <jf2512@att.com>
Wed, 23 May 2018 20:13:07 +0000 (20:13 +0000)
committerGerrit Code Review <gerrit@onap.org>
Wed, 23 May 2018 20:13:07 +0000 (20:13 +0000)
src/main/java/org/onap/aai/restclient/client/RestClient.java

index cfeeb27..a00c0ef 100644 (file)
@@ -611,7 +611,9 @@ public class RestClient {
         builder.header(header.getKey(), String.join(";",header.getValue()));
       }
       
-      if (clientBuilder.getAuthenticationMode() == RestAuthenticationMode.SSL_BASIC) {
+      //Added additional check to prevent adding duplicate authorization header if client is already sending the authorization header 
+      // AAI-1097 - For AAI calls when Rest authentication mode is selected as SSL_BASIC getting 403 error
+      if (clientBuilder.getAuthenticationMode() == RestAuthenticationMode.SSL_BASIC && headers.get(Headers.AUTHORIZATION) == null) {
         builder = builder.header(Headers.AUTHORIZATION,
             clientBuilder.getBasicAuthenticationCredentials());
       }