#access-token #oauth #spotify #flow #authorization #client #stdin

librespot-oauth

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

2 unstable releases

0.6.0 Oct 30, 2024
0.5.0 Oct 15, 2024

#260 in Audio

Download history 314/week @ 2024-10-10 995/week @ 2024-10-17 2425/week @ 2024-10-24 2457/week @ 2024-10-31 2237/week @ 2024-11-07 2281/week @ 2024-11-14 1671/week @ 2024-11-21 2616/week @ 2024-11-28 2173/week @ 2024-12-05

9,224 downloads per month
Used in 9 crates (4 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–19MB
~266K SLoC