Changed credentials value for device mqtt basic auth

This commit is contained in:
zbeacon 2020-11-17 10:57:02 +02:00 committed by Andrew Shvayka
parent 6a6bd6117b
commit a2afde6261

View File

@ -418,9 +418,14 @@ public class JsonConverter {
if (toGateway) {
result.addProperty("id", requestId);
}
switch (payload.getCredentialsType()) {
case ACCESS_TOKEN:
case X509_CERTIFICATE:
result.addProperty("credentialsValue", payload.getCredentialsValue());
case MQTT_BASIC:
result.add("credentialsValue", JSON_PARSER.parse(payload.getCredentialsValue()).getAsJsonObject());
}
result.addProperty("credentialsType", payload.getCredentialsType().name());
result.addProperty("credentialsValue",
StringUtils.isEmpty(payload.getCredentialsValue()) ? null : payload.getCredentialsValue());
result.addProperty("status", ProvisionResponseStatus.SUCCESS.name());
}
return result;