Provider offers an alternative to signing each request, by allowing users to generate auth tokens. The generated auth token can be used until its expiration in all supported requests. Simply omit the signature parameter and add the AuthToken request header based on a created token.
Please note that if a signature parameter exists, it will take precedence over the AuthToken headers. All routes that support a signature parameter support the replacement, with the exception of auth-related ones (createAuthToken and deleteAuthToken need to be signed).
Description: Allows the user to create an authentication token that can be used to authenticate requests to the provider API, instead of signing each request. The generated auth token can be used until its expiration in all supported requests.
address: The Ethereum address of the consumer (Optional).
nonce: A unique identifier for this request, to prevent replay attacks (Required).
signature: A digital signature proving ownership of the
address. The signature should be generated by signing the hashed concatenation of the
expiration: A valid future UTC timestamp representing when the auth token will expire (Required).
Inside the angular brackets, the user should provide the valid values for the request.
Allows the user to delete an existing auth token before it naturally expires.
address: String object containing consumer's address (optional)
nonce: Integer, Nonce (required)
signature: String object containg user signature (signed message)
The signature is based on hashing the following parameters:
address + nonce
token: token to be expired
Returns: Success message if token is successfully deleted. If the token is not found or already expired, returns an error message.
const axios = require('axios');