Skip to content
CCPEDIAby Unity Nodes
Discussions/App Development/Custom token vs user tokenForum ↗

Custom token vs user token

App Development2 posts250 views1 likesLast activity Jun 2023
FR
FrankieOP
Jun 2023

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?

FR
Frankie
Jun 2023

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

← Back to Discussions