MainNet: Authorization Failed for administrator when calling /admin/participant/identities (resolved)

Hey,

I ran into an issue while trying to export validator identities on MainNet using the docker-compose setup (v0.5.17), and wanted to share the solution in case it helps others.

Initially, I followed the same approach that worked for me on DevNet:

token=$(python3 get-token.py administrator)

curl -s “http://wallet.localhost/api/validator/v0/admin/participant/identities” 
-H “authorization: Bearer $token”

However, on MainNet this consistently returned:
{“error”:“Authorization Failed for administrator”}

Context:

  • Validator was fully operational and receiving rewards
  • Wallet UI worked fine (I could log in as “administrator”)

:white_check_mark: Root cause:

The issue was that I was using the wrong user in the JWT (sub field).

For this endpoint, the token must be generated with the ledger API user, not the wallet/UI user.

:cross_mark: This does NOT work:
python3 get-token.py administrator

:white_check_mark: This works:

token=$(python3 get-token.py ledger-api-user)

curl -s “http://wallet.localhost/api/validator/v0/admin/participant/identities” 
-H “authorization: Bearer $token” 
-o /root/.canton/validator-identities.json

After switching to ledger-api-user, the request succeeded.

Thanks for the tip, Lefey | ITRocket!!!
Hope this helps someone!