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 edbce0c44ab6f27f5a949bd58240db67ca2ef2e0..2b4be7d15e95dd48cf2752773701e9e0db7a9689 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 90720d7e68fd367fc51d780c2c7647aca1def9f4..83f28ad46df59e7c44227b9e126e76b5056db199 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) {