From 98bbd6927ddd4514e8b94406f331e788a6be98f7 Mon Sep 17 00:00:00 2001
From: komakkar <komakkar@microsoft.com>
Date: Fri, 20 Nov 2020 23:53:23 +0530
Subject: [PATCH] intermediate changes

---
 .../org/opengroup/osdu/notification/api/PubsubEndpoint.java  | 5 ++++-
 .../azure/util/ServiceAccountJwtAzureClientImpl.java         | 2 +-
 2 files changed, 5 insertions(+), 2 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 edbce0c44..2b4be7d15 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
@@ -86,6 +86,7 @@ public class PubsubEndpoint {
     @PostMapping("/records-changed")
     @PreAuthorize("@authorizationFilter.hasAnyPermission('" + Config.OPS + "', '" + Config.PUBSUB + "')")
     public ResponseEntity recordChanged() throws Exception {
+        this.log.info("komakkar recieved recoreds changed request " );
         if(this.pubsubRequestBodyExtractor.isHandshakeRequest()) {
             String handshakeResponse = this.pubsubHandshakeHandler.getHandshakeResponse();
             return ResponseEntity.ok(handshakeResponse);
@@ -122,10 +123,12 @@ public class PubsubEndpoint {
             requestHeader.put("Authorization", idToken);
         }
 
-        this.log.info("sending out notification to endpoint: " + endpoint);
+        this.log.info("komakkar sending out notification to endpoint: " + pushUrl);
         requestHeader.put(DpsHeaders.CONTENT_TYPE, "application/json");
         requestHeader.put(DpsHeaders.CORRELATION_ID, headerAttributes.get(DpsHeaders.CORRELATION_ID));
         requestHeader.put(DpsHeaders.DATA_PARTITION_ID, headerAttributes.get(DpsHeaders.DATA_PARTITION_ID));
+        this.log.info("komakkar sending out notification to endpoint: " + headers.toString());
+
         HttpRequest request = HttpRequest.post().url(pushUrl).headers(requestHeader).body(pubsubMessage).connectionTimeout(WAITING_TIME).build();
         HttpResponse response = httpClient.send(request);
         if (!response.isSuccessCode()) {
diff --git a/provider/notification-azure/src/main/java/org/opengroup/osdu/notification/provider/azure/util/ServiceAccountJwtAzureClientImpl.java b/provider/notification-azure/src/main/java/org/opengroup/osdu/notification/provider/azure/util/ServiceAccountJwtAzureClientImpl.java
index 90720d7e6..83f28ad46 100644
--- a/provider/notification-azure/src/main/java/org/opengroup/osdu/notification/provider/azure/util/ServiceAccountJwtAzureClientImpl.java
+++ b/provider/notification-azure/src/main/java/org/opengroup/osdu/notification/provider/azure/util/ServiceAccountJwtAzureClientImpl.java
@@ -87,7 +87,7 @@ public class ServiceAccountJwtAzureClientImpl implements IServiceAccountJwtClien
             Future<AuthenticationResult> future = context.acquireToken(this.config.getAadClientID(), credential, null);
 
             if (future == null) {
-                throw new AppException(HttpStatus.SC_FORBIDDEN, "Access denied", "The user is not authorized to perform this action");
+                throw new AppException(HttpStatus.SC_FORBIDDEN, "Token not generated", "The user is not authorized to obtain Token From AAD");
             }
             ACCESS_TOKEN = future.get().getAccessToken();
         } catch (MalformedURLException malformedURLException) {
-- 
GitLab