mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Merge branch 'apim420' of https://repository.entgra.net/tcdlpds/device-mgt-core into apim420
This commit is contained in:
commit
317af213be
@ -62,7 +62,7 @@ public interface ConsumerRESTAPIServices {
|
||||
throws APIServicesException, BadRequestException, UnexpectedResponseException;
|
||||
|
||||
ApplicationKey updateGrantType(TokenInfo tokenInfo, String applicationId, String keyMapId, String keyManager,
|
||||
String supportedGrantTypes, String callbackUrl)
|
||||
List<String> supportedGrantTypes, String callbackUrl)
|
||||
throws APIServicesException, BadRequestException, UnexpectedResponseException;
|
||||
|
||||
KeyManager[] getAllKeyManagers(TokenInfo tokenInfo)
|
||||
|
||||
@ -729,7 +729,7 @@ public class ConsumerRESTAPIServicesImpl implements ConsumerRESTAPIServices {
|
||||
|
||||
@Override
|
||||
public ApplicationKey updateGrantType(TokenInfo tokenInfo, String applicationId, String keyMapId, String keyManager,
|
||||
String supportedGrantTypes, String callbackUrl)
|
||||
List<String> supportedGrantTypes, String callbackUrl)
|
||||
throws APIServicesException, BadRequestException, UnexpectedResponseException {
|
||||
|
||||
ApiApplicationInfo apiApplicationInfo = tokenInfo.getApiApplicationInfo();
|
||||
@ -746,16 +746,19 @@ public class ConsumerRESTAPIServicesImpl implements ConsumerRESTAPIServices {
|
||||
+ tokenInfo.getAccessToken());
|
||||
}
|
||||
|
||||
String payload = "{\n" +
|
||||
" \"keyMappingId\": \"" + keyMapId + "\",\n" +
|
||||
" \"keyManager\": \"" + keyManager + "\",\n" +
|
||||
" \"supportedGrantTypes\": [\n" +
|
||||
" \"" + supportedGrantTypes + "\"\n" +
|
||||
" ],\n" +
|
||||
" \"callbackUrl\": \"" + callbackUrl + "\",\n" +
|
||||
" \"additionalProperties\": {}\n" +
|
||||
"}";
|
||||
RequestBody requestBody = RequestBody.create(JSON, payload);
|
||||
JSONArray supportedGrantTypeList = new JSONArray();
|
||||
for (String string : supportedGrantTypes) {
|
||||
supportedGrantTypeList.put(string);
|
||||
}
|
||||
|
||||
JSONObject payload = new JSONObject();
|
||||
payload.put("keyMappingId", keyMapId);
|
||||
payload.put("keyManager", keyManager);
|
||||
payload.put("supportedGrantTypes", supportedGrantTypeList);
|
||||
payload.put("callbackUrl", (callbackUrl != null ? callbackUrl : ""));
|
||||
payload.put("additionalProperties", new JSONObject());
|
||||
|
||||
RequestBody requestBody = RequestBody.create(JSON, payload.toString());
|
||||
|
||||
builder.put(requestBody);
|
||||
Request request = builder.build();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user