REST Authentication - EOSIO specific
To authenticate REST requests, specify an
Authorization: Bearer [JWT token] header in the HTTP request. See more details
curl -H "Authorization: Bearer YOURTOKENHERE" -u https://mainnet.eos.dfuse.io/v0/state/... [ ... ]
eosc -H "Authorization: Bearer YOURTOKENHERE" -u https://mainnet.eos.dfuse.io [ ... ]
Don’t forget to replace the token in the above command with a valid JWT, retrieved using
WebSocket Authentication - EOSIO specific
This example uses the https://github.com/hashrocket/ws command-line WebSocket program. To authenticate with query string, use this code:
With browser-based WebSocket connections, it is not possible to specify additional headers. In this situation, pass your JWT as the
token query string parameter.
You can pass the
token query string parameter to authenticate REST or WebSocket requests.
Origin header is currently not mandatory on websocket connections.
It will, however, become mandatory at a later date, but only for
web_ keys. It will then need to match the origin that you registered along with your API key identity. In a web environment, this is usually added automatically from the client’s browser without requiring extra work.