Commit a2afde6261083bbecd6901b87b7ee01d3a5e848b

Authored by zbeacon
Committed by Andrew Shvayka
1 parent 6a6bd611

Changed credentials value for device mqtt basic auth

... ... @@ -418,9 +418,14 @@ public class JsonConverter {
418 418 if (toGateway) {
419 419 result.addProperty("id", requestId);
420 420 }
  421 + switch (payload.getCredentialsType()) {
  422 + case ACCESS_TOKEN:
  423 + case X509_CERTIFICATE:
  424 + result.addProperty("credentialsValue", payload.getCredentialsValue());
  425 + case MQTT_BASIC:
  426 + result.add("credentialsValue", JSON_PARSER.parse(payload.getCredentialsValue()).getAsJsonObject());
  427 + }
421 428 result.addProperty("credentialsType", payload.getCredentialsType().name());
422   - result.addProperty("credentialsValue",
423   - StringUtils.isEmpty(payload.getCredentialsValue()) ? null : payload.getCredentialsValue());
424 429 result.addProperty("status", ProvisionResponseStatus.SUCCESS.name());
425 430 }
426 431 return result;
... ...