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 9ae87d9e0a34ee5506cafd5f888cefc30bd34cd9..01214bc5c46d4a33ea7514ea2edcbdccfa691099 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,6 +155,8 @@ public class PubsubEndpoint { private String querySubscriptionAndUpdateCache(String notificationId) throws Exception { Map<String,String> hmap = headers.getHeaders(); + 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 9ebc145a90dcf01fa3f0d3e23263cb9b1c6bd815..f4f41141f3d47e798a017340b173cc179e7088e3 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-feat-deshruch-oauth-changes-SNAPSHOT</version> + <version>0.3.14-oauth-feat-deshruch-oauth-changes-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 13a5fa6d79ecf71cb94a1b4af28b2888ad571c6f..6f9dfbc2c6d121cabca3d720e79a5046e7d487a9 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 @@ -108,19 +108,14 @@ public class ServiceAccountJwtAwsClientImpl implements IServiceAccountJwtClient Parameter paramsResult = paramResult.getParameter(); client_credentials_clientid = paramsResult.getValue(); client_credentials_secret = getSecret(client_secret_secretName,amazonRegion,client_secret_key); - String token= getServicePrincipalCredentials(); - System.out.println(token); + } } @Override public String getIdToken(String s) { - String token= getServicePrincipalCredentials(); - System.out.println("Printing the client credentials token generated"); - System.out.println(token); return token; - } public String getServicePrincipalCredentials() @@ -147,13 +142,13 @@ public class ServiceAccountJwtAwsClientImpl implements IServiceAccountJwtClient { System.out.println("Could not parse AccessToken result to get access_token"); } - return token; + return "Bearer "+token; } public String getSecret(String secretName, String region,String secretKey) { -String secretVaue=""; + String secretVaue=""; // Create a Secrets Manager client AWSSecretsManager client = AWSSecretsManagerClientBuilder.standard() .withRegion(region) diff --git a/testing/notification-test-aws/pom.xml b/testing/notification-test-aws/pom.xml index 20f18a766fb7d82f0bbf7c06c797c49b6ca1ccbc..50ef297b5a13aa5367599e225d62c106b0bab7b5 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-feat-deshruch-oauth-changes-SNAPSHOT</version> + <version>0.3.14-oauth-feat-deshruch-oauth-changes-SNAPSHOT</version> </dependency> <dependency> <groupId>com.amazonaws</groupId>