Overview
The following methods can be used to authenticate your requests to the Coinbase Developer Platform (CDP). Choose the method that best suits your needs:
Visit the CDP Authentication docs for more details.
Generate a JWT
The following example shows how to generate a JWT token, which can then be injected manually into yourAuthorization header to authenticate REST API requests to the CDP APIs using the HTTP request library of your choice.
Step 1: Install the required package:
Authorization header of your HTTP request:
Generate your authorization headers
The following example shows how to generate the required authentication headers for authenticating a request to the CDP REST APIs, using the HTTP request library of your choice. Step 1: Install the required package:Use an Axios request interceptor
Step 1: Install the required packages:- Generate a JWT for each request
- Add the JWT to the
Authorizationheader - Set the appropriate
Content-Typeheader - Add wallet authentication when required
Authentication parameters
The following table provides more context of many of the authentication parameters used in the examples above:
* Either all three request parameters (
requestMethod, requestHost, and requestPath) must be provided for REST API requests, or all three must be null for JWTs intended for websocket connections.