Authentication Header not found after activating authentication on the Daml on SQL Driver

After using the --auth-jwt-rs256-jwks argument to activate authentication on the Daml Driver, I’m getting the following log messages:

INFO: Initialized DAML-on-SQL version 1.9.0 with ledger-id = ..., port = ..., dar file = List(...), time mode = wall-clock time, ledger = postgres, auth-service = AuthServiceJWT, contract ids seeding = strong

WARN: Authorization error: Authorization header not found

Can someone help me resolve the Warning?

1 Like

This also happens with the sandbox.

1 Like

This error arises if your ledger client does not set the Authorization field in the gRPC metadata. Which Ledger Client are you using? For things like daml script, navigator, … we provide an --access-token-file flag which you can use here.

1 Like

Is the health endpoint also protected? I.e. do I need a valid JWT to get a response from the health endpoint?

1 Like

No, the health endpoint does not require a JWT.

2 Likes

We are investigating which client might be the culprit. Thanks!

2 Likes

It looks like the reflection endpoint might require authorization so if you call the healthcheck endpoint via grpcurl, this might cause issues.

1 Like

I don’t think it does, both health and reflection should be accessible without a JWT (looking at this code).

1 Like

That’s odd, I definitely get an error if I try to call the healthcheck endpoint via grpcurl and I have authorization enabled. I don’t really see what other services it could call besides healthcheck and reflection.

1 Like

Uh, then I must be looking at the wrong code. Apologies for the confusion.

1 Like

Does that mean I need a similar JWT to the one from the JSON API? i.e. no actAs, readAs, or admin claims? It just needs to have the proper structure and signature?

1 Like

That should definitely work. However, if that is required I think there is a bug somewhere. You shouldn’t need authorization to call the healthcheck endpoint and I don’t think it makes sense for the reflection endpoint either.

1 Like

This turned out to be a bug which has since been fixed in the latest 1.11.0 snapshot as well as backported to version 1.10.2 of the Daml Driver for PostgreSQL.