From a78da4a4a9450c1e2a8230d66a3de012a6879288 Mon Sep 17 00:00:00 2001 From: navodzoysa Date: Wed, 23 Nov 2022 12:12:10 +0530 Subject: [PATCH] Fix build failure --- .../apimgt/keymgt/extension/api/KeyManagerService.java | 4 +++- .../apimgt/keymgt/extension/api/KeyManagerServiceImpl.java | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.keymgt.extension.api/src/main/java/org/wso2/carbon/apimgt/keymgt/extension/api/KeyManagerService.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.keymgt.extension.api/src/main/java/org/wso2/carbon/apimgt/keymgt/extension/api/KeyManagerService.java index 32f4e5112a..e95bae064d 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.keymgt.extension.api/src/main/java/org/wso2/carbon/apimgt/keymgt/extension/api/KeyManagerService.java +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.keymgt.extension.api/src/main/java/org/wso2/carbon/apimgt/keymgt/extension/api/KeyManagerService.java @@ -46,5 +46,7 @@ public interface KeyManagerService { @FormParam("scope") String scope, @FormParam("grant_type") String grantType, @FormParam("assertion") String assertion, - @FormParam("admin_access_token") String admin_access_token); + @FormParam("admin_access_token") String admin_access_token, + @FormParam("username") String username, + @FormParam("password") String password); } diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.keymgt.extension.api/src/main/java/org/wso2/carbon/apimgt/keymgt/extension/api/KeyManagerServiceImpl.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.keymgt.extension.api/src/main/java/org/wso2/carbon/apimgt/keymgt/extension/api/KeyManagerServiceImpl.java index 3e2141d07e..69d36e9b00 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.keymgt.extension.api/src/main/java/org/wso2/carbon/apimgt/keymgt/extension/api/KeyManagerServiceImpl.java +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.keymgt.extension.api/src/main/java/org/wso2/carbon/apimgt/keymgt/extension/api/KeyManagerServiceImpl.java @@ -69,7 +69,9 @@ public class KeyManagerServiceImpl implements KeyManagerService { @FormParam("scope") String scope, @FormParam("grant_type") String grantType, @FormParam("assertion") String assertion, - @FormParam("admin_access_token") String admin_access_token) { + @FormParam("admin_access_token") String admin_access_token, + @FormParam("username") String username, + @FormParam("password") String password) { try { if (basicAuthHeader == null) { String msg = "Invalid credentials. Make sure your API call is invoked with a Basic Authorization header."; @@ -80,7 +82,7 @@ public class KeyManagerServiceImpl implements KeyManagerService { TokenResponse resp = keyMgtService.generateAccessToken( new TokenRequest(encodedClientCredentials.split(":")[0], encodedClientCredentials.split(":")[1], refreshToken, scope, - grantType, assertion,admin_access_token)); + grantType, assertion, admin_access_token, username, password)); return Response.status(Response.Status.OK).entity(gson.toJson(resp)).build(); } catch (KeyMgtException e) { return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(e.getMessage()).build();