Hello everybody!
Here is my error:
java.util.concurrent.ExecutionException: io.grpc.StatusRuntimeException: PERMISSION_DENIED: An error occurred. Please contact the operator and inquire about the request <no-correlation-id>
It happens when I send a grpc request from Java app with bindings to the ledger on the Daml Hub.
How do I do it?
- I created a service account for my Java app on behalf of the party that will send the grpc request.
- There is a token (Cred ID) for the new account. I use it against .daml.app/.hub/v1/sa/login
- I get two tokens in response: accessToken and token
- inside my java app I build DamlClient like this:
DamlLedgerClient
.newBuilder(host, port)
.withSslContext(GrpcSslContexts.forClient().build())
.withAccessToken(token)
.build();
The host is my daml hub host and the port is 443
When I send a request through this I get PERMISSION_DENIED error. What can be wrong? As a token I use “token” from the login endpoint response. When I use “access_token” or just a manually crafted garbage string I get UNAUTHORIZED. What is the correct token for this?
I read this post
I thought that maybe the reason is that I created a service for the wrong party but everything looks good, I double-checked.
The code is working fine if I run the sandbox ledger and send requests with the simple builder: no SSL and Token.
Thanks!