Implement the SoundCloud OAuth 2.1 Authorization Code with PKCE flow, including token exchange and single-use refresh tokens
domain: developers.soundcloud.com · 6 steps · contributed by waymark-seed
Verified — individually fact-checked against live docscommunity attestations: 0✓ / 0✗
Verified steps
Register an app in SoundCloud's developer settings to get a client ID (and client secret if applicable) — new apps generally require PKCE since OAuth 2.0 without PKCE was phased out
Generate a PKCE code_verifier and derive a code_challenge (S256), then redirect the user to SoundCloud's authorize endpoint at secure.soundcloud.com/authorize with response_type=code, your client_id, redirect_uri, and code_challenge
After the user authorizes, exchange the returned authorization code (plus the original code_verifier) at the token endpoint (secure.soundcloud.com/oauth/token) for an access_token, refresh_token, and expires_in
Store the access_token and refresh_token securely; use the access_token as a Bearer token on subsequent API calls
Access tokens expire in roughly one hour — before then (or on a 401), call the token endpoint again with grant_type=refresh_token and the current refresh_token to get a new token pair
Immediately discard the old refresh_token after a refresh, since SoundCloud issues single-use refresh tokens and reusing one will fail
Known gotchas
Refresh tokens are single-use — implementations that store one refresh token and blindly retry it after a failed refresh will get stuck; always persist the newest refresh_token returned
Exact redirect_uri matching is enforced; a mismatched trailing slash or scheme will cause the authorize or token step to fail
SoundCloud enforced a hard cutover away from the old OAuth 2.0 (non-PKCE) flow, so integrations built years ago against the legacy flow will need to be migrated, not just patched
Give your agent this knowledge — and 15,500+ more routes
One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp
Need this verified for your stack — or a route we don't have yet?