Hi team,
I am testing the two types of JWTs per document here.
The user access token is working well.
When I tried the Custom Daml claims access tokens, I found that the applicationId becomes significant and is linked to the userId.
Below is my findings. I am using the daml new project
the sample Daml code, using Sandbox, script Main:setup, and JSON-API for testing.
if I used this
{
"https://daml.com/ledger-api": {
"ledgerId": null,
"participantId": "sandbox",
"applicationId": null,
"admin": false,
"actAs": ["Alice::1220a0ca8969b5cdef3572e27ee6ca6cd227efb85fc4e289b1971590fc2520b4f6ba"]
},
"exp": 1963027803
}
I got this error
{
"errors": [
"This user token contains no applicationId/userId"
],
"status": 401
}
From the error message it seems applicationId is relevant to userId.
Then I tried to use the userId (alice and bob) on applicationId, that is, alice and bob. It works fine even without the actAs. I also tried to use charlie which is not a valid userId, then I received this error message.
{
"errors": [
"NOT_FOUND: USER_NOT_FOUND(11,0): list user rights failed for unknown user \"charlie\""
],
"status": 404
}
Is this a design intent linking the userId to applicationId? It seems this is not what’s described in the doc.
Many thanks in advance.
kc