|
|
|
@ -26,6 +26,7 @@ import org.springframework.util.Assert; |
|
|
|
import org.thingsboard.server.common.data.Customer; |
|
|
|
import org.thingsboard.server.common.data.User; |
|
|
|
import org.thingsboard.server.common.data.id.CustomerId; |
|
|
|
import org.thingsboard.server.common.data.id.EntityId; |
|
|
|
import org.thingsboard.server.common.data.id.UUIDBased; |
|
|
|
import org.thingsboard.server.common.data.id.UserId; |
|
|
|
import org.thingsboard.server.common.data.security.Authority; |
|
|
|
@ -111,7 +112,7 @@ public class RestAuthenticationProvider implements AuthenticationProvider { |
|
|
|
if (!publicCustomer.isPublic()) { |
|
|
|
throw new BadCredentialsException("Authentication Failed. Public Id is not valid."); |
|
|
|
} |
|
|
|
User user = new User(new UserId(UUIDBased.EMPTY)); |
|
|
|
User user = new User(new UserId(EntityId.NULL_UUID)); |
|
|
|
user.setTenantId(publicCustomer.getTenantId()); |
|
|
|
user.setCustomerId(publicCustomer.getId()); |
|
|
|
user.setEmail(publicId); |
|
|
|
|