From 4ad50766066dd09fdc061e156950e376b866d9af Mon Sep 17 00:00:00 2001
From: Rucha Deshpande <deshruch@amazon.com>
Date: Mon, 16 Nov 2020 12:26:29 -0600
Subject: [PATCH] oauth client credentials

---
 .../org/opengroup/osdu/notification/api/PubsubEndpoint.java     | 2 +-
 provider/notification-aws/pom.xml                               | 2 +-
 .../provider/aws/impl/ServiceAccountJwtAwsClientImpl.java       | 1 +
 testing/notification-test-aws/pom.xml                           | 2 +-
 4 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/notification-core/src/main/java/org/opengroup/osdu/notification/api/PubsubEndpoint.java b/notification-core/src/main/java/org/opengroup/osdu/notification/api/PubsubEndpoint.java
index 01214bc5c..bfe12ea15 100644
--- a/notification-core/src/main/java/org/opengroup/osdu/notification/api/PubsubEndpoint.java
+++ b/notification-core/src/main/java/org/opengroup/osdu/notification/api/PubsubEndpoint.java
@@ -155,7 +155,7 @@ public class PubsubEndpoint {
 
     private String querySubscriptionAndUpdateCache(String notificationId) throws Exception {
         Map<String,String> hmap = headers.getHeaders();
-        String auth_header = hmap.get("Authorization");
+        String auth_header = hmap.get("authorization");
         System.out.println("Notification token before creating subscription service= "+auth_header);
 
         ISubscriptionService service = subscriptionFactory.create(headers);
diff --git a/provider/notification-aws/pom.xml b/provider/notification-aws/pom.xml
index f4f41141f..f7e76b744 100644
--- a/provider/notification-aws/pom.xml
+++ b/provider/notification-aws/pom.xml
@@ -50,7 +50,7 @@
         <dependency>
             <groupId>org.opengroup.osdu.core.aws</groupId>
             <artifactId>os-core-lib-aws</artifactId>
-            <version>0.3.14-oauth-feat-deshruch-oauth-changes-SNAPSHOT</version>
+            <version>0.3.12-SNAPSHOT</version>
         </dependency>
 
         <!-- https://mvnrepository.com/artifact/com.amazonaws/aws-java-sdk-secretsmanager -->
diff --git a/provider/notification-aws/src/main/java/org/opengroup/osdu/notification/provider/aws/impl/ServiceAccountJwtAwsClientImpl.java b/provider/notification-aws/src/main/java/org/opengroup/osdu/notification/provider/aws/impl/ServiceAccountJwtAwsClientImpl.java
index 6f9dfbc2c..2ef26c3f5 100644
--- a/provider/notification-aws/src/main/java/org/opengroup/osdu/notification/provider/aws/impl/ServiceAccountJwtAwsClientImpl.java
+++ b/provider/notification-aws/src/main/java/org/opengroup/osdu/notification/provider/aws/impl/ServiceAccountJwtAwsClientImpl.java
@@ -129,6 +129,7 @@ public class ServiceAccountJwtAwsClientImpl implements IServiceAccountJwtClient
         headers.put("Content-Type", "application/x-www-form-urlencoded");
         IHttpClient httpClient = new HttpClient();
         String url = tokenUrl+"?grant_type=client_credentials&client_id="+client_credentials_clientid+"&scope="+awsOauthCustomScope;
+        System.out.println("Token url="+url);
         HttpRequest rq = HttpRequest.post().url(url).headers(headers).build();
 
 
diff --git a/testing/notification-test-aws/pom.xml b/testing/notification-test-aws/pom.xml
index 50ef297b5..6b180e62e 100644
--- a/testing/notification-test-aws/pom.xml
+++ b/testing/notification-test-aws/pom.xml
@@ -44,7 +44,7 @@
         <dependency>
             <groupId>org.opengroup.osdu.core.aws</groupId>
             <artifactId>os-core-lib-aws</artifactId>
-            <version>0.3.14-oauth-feat-deshruch-oauth-changes-SNAPSHOT</version>
+            <version>0.3.12-SNAPSHOT</version>
         </dependency>
         <dependency>
             <groupId>com.amazonaws</groupId>
-- 
GitLab