From 45e753f68fdfd51ad5cb058605e7e0c34cf4a13e Mon Sep 17 00:00:00 2001 From: "tcdlpds@gmail.com" Date: Fri, 17 Jul 2020 19:31:38 +0530 Subject: [PATCH] Construct API endpoint to get default token --- .../entgra/ui/request/interceptor/DefaultTokenHandler.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/DefaultTokenHandler.java b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/DefaultTokenHandler.java index 7d89550ef1d..a500c0027be 100644 --- a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/DefaultTokenHandler.java +++ b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/DefaultTokenHandler.java @@ -71,11 +71,11 @@ public class DefaultTokenHandler extends HttpServlet { if (HandlerConstants.HTTP_PROTOCOL.equals(req.getScheme())) { iotsCorePort = System.getProperty("iot.core.http.port"); } + String tokenUrl = req.getScheme() + HandlerConstants.SCHEME_SEPARATOR + System.getProperty("iot.core.host") - + HandlerConstants.COLON + iotsCorePort + "/api/device-mgt/v1.0/devices" + clientId - + HandlerConstants.SCHEME_SEPARATOR + clientSecret + HandlerConstants.SCHEME_SEPARATOR - + "default-token"; + + HandlerConstants.COLON + iotsCorePort + "/api/device-mgt/v1.0/devices/" + clientId + + "/" + clientSecret + "/default-token"; HttpGet defaultTokenRequest = new HttpGet(tokenUrl); defaultTokenRequest