Retrieve an OAuth access token, to be used for authentication of โprivateโ requests.
๐ Related Article: Authentication
Authentication Methods:
Three methods of authentication are supported:
client_credentials - Using the client id and client secret that can be found on the API page on the website. This is the simplest method, suitable for server-to-server applications and quick setup.
client_signature - Enhanced security method that uses a cryptographic signature instead of sending the client secret directly. You generate an HMAC-SHA256 signature of a string containing a timestamp, a random nonce, and optional data, using your Client Secret as the key. This method requires `client_id`, `timestamp` (current time in milliseconds), `nonce`, `signature`, and optionally a `data` field. Deribit verifies the signature instead of requiring the raw secret. Best for enhanced security, asymmetric key pairs, and avoiding secret transmission. See the Client Signature (WebSocket) guide for detailed signature calculation instructions.
refresh_token - Using a refresh token that was received from an earlier invocation. This allows you to obtain a new access token without re-supplying your Client ID and Client Secret. Best for long-lived sessions, token renewal, and avoiding re-authentication.
Response:
The response will contain an access token, expiration period (number of seconds that the token is valid) and a refresh token that can be used to get a new set of tokens.
Method of authentication
client_credentials, client_signature, refresh_token "client_credentials"
Required for grant type `client_credentials` and `client_signature`
"fo7WAPRm4P"
Required for grant type `client_credentials`
"W0H6FJW4IRPZ1MOQ8FP6KMC5RZDUUKXS"
Required for grant type `refresh_token`
Required for grant type `client_signature`.
Provides time when request has been generated (milliseconds since the UNIX epoch).
Required for grant type `client_signature`.
It's a cryptographic signature calculated over provided fields using user secret key. The signature should be calculated as an HMAC (Hash-based Message Authentication Code) with `SHA256` hash algorithm.
Optional for grant type `client_signature`.
Delivers user generated initialization vector for the server token.
Optional for grant type `client_signature`.
Contains any user specific value.
Will be passed back in the response.
Describes type of the access for assigned token.
Possible values:
`connection``session:name``trade:[read, read_write, none]``wallet:[read, read_write, none]``account:[read, read_write, none]``expires:NUMBER``ip:ADDR`Details are elucidated in Access scope
"connection"