Prerequisites
Before integrating OAuth2, ensure you have the following:OAuth client access
OAuth client access
OAuth client creation is currently limited to approved partners. To request access:
- Create an account on the CDP Portal
- Contact your Coinbase representative to request OAuth whitelisting
- Once approved, you can create OAuth clients under API Keys > OAuth
Testing requirements
Testing requirements
OAuth2 testing requires real Coinbase accounts as there is no sandbox or test user functionality. All testing occurs in the production environment.To test the OAuth flow, you will need:
- A Coinbase account
- Completed identity verification (KYC), which includes providing ID and SSN for US accounts
Geographic availability
Geographic availability
OAuth2 integration is primarily designed for US-based users. Team members in other regions may face limitations when testing:
- Some features may not be available in all jurisdictions
- KYC requirements vary by country
- Certain API endpoints are US-only
Firewall allowlisting
Firewall allowlisting
If your organization requires firewall allowlisting, add the following domains:
api.coinbase.com— All API requests (auth and feature APIs)login.coinbase.com— OAuth authorization flow
There are no separate staging or non-prod hosts. All development, testing, and production use the same endpoints.
Overview
This guide walks you through integrating OAuth2 to access Coinbase user accounts:- Register an OAuth application
- Redirect users to authorize
- Exchange the authorization code for tokens
- Make authenticated API requests
1. Register your OAuth application
Go to CDP Portal OAuth settings and create a new OAuth2 application. You’ll receive:- Client ID: Public identifier for your application
- Client Secret: Keep this secure—never expose in client-side code
2. Redirect users to authorize
3. Exchange code for tokens
4. Make authenticated requests
Token lifecycle
| Token Type | Lifetime | Usage |
|---|---|---|
| Access Token | 1 hour | Authenticate API requests |
| Refresh Token | 1.5 years | Obtain new access tokens |