#oauth #spotify #access-token

librespot-oauth

OAuth authorization code flow with PKCE for obtaining a Spotify access token

1 unstable release

0.5.0 Oct 15, 2024

#269 in Audio

Download history 611/week @ 2024-10-12 1104/week @ 2024-10-19

1,715 downloads per month
Used in 8 crates (3 directly)

MIT license

15KB
226 lines

Provides a Spotify access token using the OAuth authorization code flow with PKCE.

Assuming sufficient scopes, the returned access token may be used with Spotify's Web API, and/or to establish a new Session with librespot_core.

The authorization code flow is an interactive process which requires a web browser to complete. The resulting code must then be provided back from the browser to this library for exchange into an access token. Providing the code can be automatic via a spawned http server (mimicking Spotify's client), or manually via stdin. The latter is appropriate for headless systems.

Dependencies

~6–21MB
~270K SLoC