[GH-ISSUE #1085] Support token configuration from file system. #506

Closed
opened 2026-02-27 19:31:01 +03:00 by kerem · 4 comments
Owner

Originally created by @GiviMAD on GitHub (Dec 28, 2022).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/1085

Hi, awesome project, just discovered it after thinking there were no replacement for libspotify.

Will be possible to support providing a Spotify token from the filesystem?
I have a web application and I would like to use librespot to enable Spotify support when running on desktop through electron (when running on web I use the Spotify Web SDK). So I already have a valid spotify token on the client.

My question is, is it possible to add support in librespot to just gather a token from a file and forget about any authentication just assuming it will always have a valid token there?

Another possibility that will solve my "problem", will be supporting creating the credentials cache file programmatically with a valid refresh token and auth_type 3.

Do you think any of these alternatives can be considered? Or maybe I have a better way to do it that I'm just missing.

Thank you in advance for the help!

Originally created by @GiviMAD on GitHub (Dec 28, 2022). Original GitHub issue: https://github.com/librespot-org/librespot/issues/1085 Hi, awesome project, just discovered it after thinking there were no replacement for libspotify. Will be possible to support providing a Spotify token from the filesystem? I have a web application and I would like to use librespot to enable Spotify support when running on desktop through electron (when running on web I use the Spotify Web SDK). So I already have a valid spotify token on the client. My question is, is it possible to add support in librespot to just gather a token from a file and forget about any authentication just assuming it will always have a valid token there? Another possibility that will solve my "problem", will be supporting creating the credentials cache file programmatically with a valid refresh token and auth_type 3. Do you think any of these alternatives can be considered? Or maybe I have a better way to do it that I'm just missing. Thank you in advance for the help!
kerem 2026-02-27 19:31:01 +03:00
Author
Owner

@roderickvd commented on GitHub (Dec 28, 2022):

Not sure what you mean, how would that be different from putting the token you got externally in librespot's cache file?

I don't know whether tokens from the web client are interchangeable with tokens used to authenticate over Mercury.

<!-- gh-comment-id:1366740657 --> @roderickvd commented on GitHub (Dec 28, 2022): Not sure what you mean, how would that be different from putting the token you got externally in librespot's cache file? I don't know whether tokens from the web client are interchangeable with tokens used to authenticate over Mercury.
Author
Owner

@GiviMAD commented on GitHub (Dec 28, 2022):

Hi, thank you for the quick response.
I already tried to put the auth_type to 3 , and put in the auth_data field my Spotify token in base64, also tried with the refresh token, without luck.
So maybe you are right and the token is not valid, I didn't know about Mercury at all.

<!-- gh-comment-id:1366813441 --> @GiviMAD commented on GitHub (Dec 28, 2022): Hi, thank you for the quick response. I already tried to put the auth_type to 3 , and put in the auth_data field my Spotify token in base64, also tried with the refresh token, without luck. So maybe you are right and the token is not valid, I didn't know about Mercury at all.
Author
Owner

@roderickvd commented on GitHub (Dec 30, 2022):

You think we can close this then?

<!-- gh-comment-id:1368061391 --> @roderickvd commented on GitHub (Dec 30, 2022): You think we can close this then?
Author
Owner

@GiviMAD commented on GitHub (Dec 31, 2022):

yes, ty!

<!-- gh-comment-id:1368224920 --> @GiviMAD commented on GitHub (Dec 31, 2022): yes, ty!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/librespot#506
No description provided.