scala - access google cloud storage using java library gets '403 forbidden' -
i'm trying use google cloud storage java library in scala list items in bucket
val credential = new googlecredential.builder() .settransport(googlenethttptransport.newtrustedtransport()) .setjsonfactory(jacksonfactory.getdefaultinstance()) .setserviceaccountid("xxx@developer.gserviceaccount.com") .setserviceaccountscopes(collections.singleton(storagescopes.devstorage_read_only)) .setserviceaccountprivatekeyfromp12file(new file("file.p12")) .build() val storage = new storage.builder( googlenethttptransport.newtrustedtransport(), jacksonfactory.getdefaultinstance(), credential) .sethttprequestinitializer(credential) .setapplicationname("app") .build() storage.objects.list("bucket").execute
however got
com.google.api.client.googleapis.json.googlejsonresponseexception: 403 forbidden { "code" : 403, "errors" : [ { "domain" : "global", "message" : "forbidden", "reason" : "forbidden" } ], "message" : "forbidden" }
my email account have access bucket, can access using gsutil creating project in account well. i've created xxx@developer.gserviceaccount.com in project in account well, idea how can set permission?
just been coming against same issue, , think we've found solution. fix it, owner of google play developer console trying access had add our service account email address google play console permissions list, , give service account financial reports privileges.
Comments
Post a Comment