|
|
@ -55,7 +55,6 @@ import org.json.JSONException;
|
|
|
|
import org.json.JSONObject;
|
|
|
|
import org.json.JSONObject;
|
|
|
|
import org.w3c.dom.Document;
|
|
|
|
import org.w3c.dom.Document;
|
|
|
|
import io.entgra.ui.request.interceptor.beans.ProxyResponse;
|
|
|
|
import io.entgra.ui.request.interceptor.beans.ProxyResponse;
|
|
|
|
import org.wso2.carbon.device.mgt.core.common.util.HttpUtil;
|
|
|
|
|
|
|
|
import org.xml.sax.SAXException;
|
|
|
|
import org.xml.sax.SAXException;
|
|
|
|
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
@ -654,7 +653,7 @@ public class HandlerUtil {
|
|
|
|
return tokenResultResponse;
|
|
|
|
return tokenResultResponse;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
public static ProxyResponse getTokenResult(AuthData authData, String keymanagerUrl) throws IOException {
|
|
|
|
public static ProxyResponse getTokenResult(AuthData authData, String keymanagerUrl) throws IOException {
|
|
|
|
HttpPost tokenEndpoint = new HttpPost(keymanagerUrl + HandlerConstants.TOKEN_ENDPOINT);
|
|
|
|
HttpPost tokenEndpoint = new HttpPost(keymanagerUrl + HandlerConstants.OAUTH2_TOKEN_ENDPOINT);
|
|
|
|
StringEntity tokenEndpointPayload = new StringEntity(
|
|
|
|
StringEntity tokenEndpointPayload = new StringEntity(
|
|
|
|
"grant_type=refresh_token&refresh_token=" + authData.getRefreshToken(),
|
|
|
|
"grant_type=refresh_token&refresh_token=" + authData.getRefreshToken(),
|
|
|
|
ContentType.APPLICATION_FORM_URLENCODED);
|
|
|
|
ContentType.APPLICATION_FORM_URLENCODED);
|
|
|
@ -735,4 +734,4 @@ public class HandlerUtil {
|
|
|
|
public static boolean isPropertyDefined(String property) {
|
|
|
|
public static boolean isPropertyDefined(String property) {
|
|
|
|
return StringUtils.isEmpty(System.getProperty(property));
|
|
|
|
return StringUtils.isEmpty(System.getProperty(property));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|