|
|
|
@ -44,7 +44,7 @@ public class APIApplicationServicesImpl implements APIApplicationServices {
|
|
|
|
|
getAPIManagerConfigurationService().getAPIManagerConfiguration();
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public APIApplicationKey createAndRetrieveApplicationCredentials()
|
|
|
|
|
public APIApplicationKey createAndRetrieveApplicationCredentials(String clientName, String grantType, String tokenType)
|
|
|
|
|
throws APIServicesException {
|
|
|
|
|
|
|
|
|
|
String applicationEndpoint = config.getFirstProperty(Constants.DCR_END_POINT);
|
|
|
|
@ -53,9 +53,10 @@ public class APIApplicationServicesImpl implements APIApplicationServices {
|
|
|
|
|
|
|
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
|
|
jsonObject.put("callbackUrl", Constants.EMPTY_STRING);
|
|
|
|
|
jsonObject.put("clientName", Constants.CLIENT_NAME);
|
|
|
|
|
jsonObject.put("grantType", Constants.GRANT_TYPE);
|
|
|
|
|
jsonObject.put("clientName", clientName);
|
|
|
|
|
jsonObject.put("grantType", grantType);
|
|
|
|
|
jsonObject.put("owner", serverUser);
|
|
|
|
|
jsonObject.put("tokenType", tokenType);
|
|
|
|
|
jsonObject.put("saasApp", true);
|
|
|
|
|
|
|
|
|
|
RequestBody requestBody = RequestBody.Companion.create(jsonObject.toString(), JSON);
|
|
|
|
@ -75,15 +76,15 @@ public class APIApplicationServicesImpl implements APIApplicationServices {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public APIApplicationKey generateAndRetrieveApplicationKeys(String username, String password)
|
|
|
|
|
public APIApplicationKey generateAndRetrieveApplicationKeys(String username, String password, String clientName, String grantType)
|
|
|
|
|
throws APIServicesException {
|
|
|
|
|
|
|
|
|
|
String applicationEndpoint = config.getFirstProperty(Constants.DCR_END_POINT);
|
|
|
|
|
|
|
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
|
|
jsonObject.put("callbackUrl", Constants.EMPTY_STRING);
|
|
|
|
|
jsonObject.put("clientName", username);
|
|
|
|
|
jsonObject.put("grantType", Constants.GRANT_TYPE);
|
|
|
|
|
jsonObject.put("clientName", clientName);
|
|
|
|
|
jsonObject.put("grantType", grantType);
|
|
|
|
|
jsonObject.put("owner", username);
|
|
|
|
|
jsonObject.put("saasApp", true);
|
|
|
|
|
|
|
|
|
|