spotify
id: api/oauth/spotify title: Spotify OAuth​
GET /api/oauth/spotify
​
Start the Spotify OAuth login/link flow. Redirects to Spotify's authorization page.
- Authentication: Requires an authenticated user (session cookie / JWT) to link the Spotify account to the current user.
- Optional
redirect_to
is encoded intostate
and used after the callback.
Response​
- 302 Found (Redirect) — Redirects to Spotify's auth URL.
Example​
curl -i -X GET "http://localhost:8080/api/oauth/spotify?redirect_to=/services" \
--cookie "token=your_jwt_token"
GET /api/oauth/spotify/callback
​
Callback endpoint for Spotify. On success the server restores redirect_to
from state
(or /
) and redirects the user. On failure the route redirects to /login
.
Response​
- 302 Found (Redirect) — Success -> restored
redirect_to
(or/
); Failure ->/login
.
Notes​
- Typical scopes requested include
user-read-email
,user-read-private
, playlists and playback-related scopes. See server config for exact scopes.