@vibelifeinc right now this is not supported but is on the roadmap. The reason why its not working right now is that a N1QL query is performed at the bucket level conceptually so passing credentials from multiple buckets is not possible.
We are working on a solution to that problem that works across the SDKs and aligns with future plans on RBAC on the server side too.
@ronzionp@vibelifeinc in SDK 2.3.3, there is a withCredentials(String, String) method on the N1qlParams builder. Each call will add a credential login/password pair to the request, so you can call this for each password protected bucket, and it should work.
Note this is kind of experimental, as a first step preparing for a Cluster-level query API which is still in the works.
@simonbasle appreciate your help. I get the following error while trying your suggestion: creds has to be of type array of { user, pass } with code 1070
my implementation is as follow: val params = N1qlParams.build() .withCredentials(BUCKET1_NAME, BUCKET1_PASS) .withCredentials(BUCKET2_NAME, BUCKET2_PASS) bucket.query(N1qlQuery.simple(MY_STATEMENT, params))