...
|
...
|
@@ -24,6 +24,7 @@ import org.springframework.beans.factory.annotation.Autowired; |
24
|
24
|
import org.springframework.beans.factory.annotation.Value;
|
25
|
25
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
26
|
26
|
import org.springframework.stereotype.Service;
|
|
27
|
+import org.springframework.util.StringUtils;
|
27
|
28
|
import org.thingsboard.server.common.data.Device;
|
28
|
29
|
import org.thingsboard.server.common.data.id.DeviceId;
|
29
|
30
|
import org.thingsboard.server.common.data.id.TenantId;
|
...
|
...
|
@@ -142,8 +143,13 @@ public class LocalTransportApiService implements TransportApiService { |
142
|
143
|
return getEmptyTransportApiResponse();
|
143
|
144
|
}
|
144
|
145
|
try {
|
|
146
|
+ ValidateDeviceCredentialsResponseMsg.Builder builder = ValidateDeviceCredentialsResponseMsg.newBuilder();
|
|
147
|
+ builder.setDeviceInfo(getDeviceInfoProto(device));
|
|
148
|
+ if(!StringUtils.isEmpty(credentials.getCredentialsValue())){
|
|
149
|
+ builder.setCredentialsBody(credentials.getCredentialsValue());
|
|
150
|
+ }
|
145
|
151
|
return TransportApiResponseMsg.newBuilder()
|
146
|
|
- .setValidateTokenResponseMsg(ValidateDeviceCredentialsResponseMsg.newBuilder().setDeviceInfo(getDeviceInfoProto(device)).setCredentialsBody(credentials.getCredentialsValue()).build()).build();
|
|
152
|
+ .setValidateTokenResponseMsg(builder.build()).build();
|
147
|
153
|
} catch (JsonProcessingException e) {
|
148
|
154
|
log.warn("[{}] Failed to lookup device by id", deviceId, e);
|
149
|
155
|
return getEmptyTransportApiResponse();
|
...
|
...
|
|