Hi in the following example that you have provided...
# troubleshooting
s
Hi in the following example that you have provided in the java client docs
final String username = "admin";
final String password = "verysecret";
// Concatenate username and password and use base64 to encode the concatenated string
String plainCredentials = username + ":" + password;
String base64Credentials = new String(
Base64.getEncoder().encode(plainCredentials.getBytes()));
String authorizationHeader = "Basic " + base64Credentials;
MapString, String headers = new HashMap();
headers.put("Authorization", authorizationHeader);
JsonAsyncHttpPinotClientTransportFactory factory =
new JsonAsyncHttpPinotClientTransportFactory();
factory.setHeaders(headers);
PinotClientTransport clientTransport = factory
.buildTransport();
Connection connection = ConnectionFactory.fromProperties(
Collections.singletonList("localhost:8000"), clientTransport);
String query = "select count(*) FROM baseballStats limit 1";
ResultSetGroup rs = connection.execute(query);
System.out.println(rs);
connection.close();
PinotClientTransport is a package private class.Is there any other way to implement authentication?
x
Usually you need to implement both client and server side authentication. In this case, suggest to have the auth header implementation outside and set it then query Pinot.
s
Do you mean to say the auth tokens are to be set in the pinot controller ,brokers,servers and zk(conf properties)? so if i set these the client process does not need any authorization?
x
You need to configure auth for all components. Client side also need to configure auth for processing
s
by client side authentication you mean to say that the class that makes the API call should have the credentials right?
yes