Custom token vs user token

Hi,

I was using a user token to access the ledger through JSON API but got this error

GET http://localhost:7575/v1/user/rights

{
    "errors": [
        "A user token was expected but a custom token was given"
    ],
    "status": 401
}

My token is like this.

{
  "statusCode": 200,
  "headers": {},
  "status": "success",
  "iss": "some URL",
  "sub": "OlmOGNOg8ROWcRQqb9c2DU5dTHQ2AfBL@clients",
  "aud": "#",
  "iat": 1687181836,
  "exp": 1687268236,
  "azp": "OlmOGNOg8ROWcRQqb9c2DU5dTHQ2AfBL",
  "gty": "client-credentials"
}

What is the user token standard and how does the system tell the differences between user token and custom token?

1 Like

Found the problem… The aud is not correct, should be in the format of https://daml.com/jwt/aud/participant/[participantID]

1 Like