[PR #983] [MERGED] adding callback for reusable credentials #1173

Closed
opened 2026-02-27 20:01:27 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/librespot-org/librespot/pull/983
Author: @Louis9902
Created: 4/2/2022
Status: Merged
Merged: 5/20/2022
Merged by: @roderickvd

Base: devHead: cred-cache


📝 Commits (3)

  • 6a34c95 change session connect to return longterm creds
  • b39f38e update changelog with api changes
  • aac4567 Merge branch 'dev' into cred-cache

📊 Changes

7 files changed (+17 additions, -8 deletions)

View changed files

📝 CHANGELOG.md (+2 -0)
📝 core/src/session.rs (+7 -4)
📝 core/tests/connect.rs (+1 -0)
📝 examples/get_token.rs (+1 -1)
📝 examples/play.rs (+1 -1)
📝 examples/playlist_tracks.rs (+1 -1)
📝 src/main.rs (+4 -1)

📄 Description

This adds a callback to the creation of the session, so the reusable credentials can be stored separately. This is useful when using a keychain or something like the secret_service api.

The way it's implemented, no API is broken but the possibility to reuse the credentials is there.

Why do I wan't this?

When using librespot without the cache, Spotify will send an email about a new login attempt when using the password credentials, with the long-lived token this does not happen. But I don't want to either use the cache or I don't want the token in a json file on my fs.

Feel free to give me some feedback or another solution, but I’m relatively new to rust, so I might ask some questions.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/librespot-org/librespot/pull/983 **Author:** [@Louis9902](https://github.com/Louis9902) **Created:** 4/2/2022 **Status:** ✅ Merged **Merged:** 5/20/2022 **Merged by:** [@roderickvd](https://github.com/roderickvd) **Base:** `dev` ← **Head:** `cred-cache` --- ### 📝 Commits (3) - [`6a34c95`](https://github.com/librespot-org/librespot/commit/6a34c95ba8cd5a1178e5008b6982d977c52ca090) change session connect to return longterm creds - [`b39f38e`](https://github.com/librespot-org/librespot/commit/b39f38ece25bbb3d7bf791e572445eb9b9367e37) update changelog with api changes - [`aac4567`](https://github.com/librespot-org/librespot/commit/aac456773c16def910b27dc6ab6f0c27a5290f5e) Merge branch 'dev' into cred-cache ### 📊 Changes **7 files changed** (+17 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+2 -0) 📝 `core/src/session.rs` (+7 -4) 📝 `core/tests/connect.rs` (+1 -0) 📝 `examples/get_token.rs` (+1 -1) 📝 `examples/play.rs` (+1 -1) 📝 `examples/playlist_tracks.rs` (+1 -1) 📝 `src/main.rs` (+4 -1) </details> ### 📄 Description This adds a callback to the creation of the session, so the reusable credentials can be stored separately. This is useful when using a keychain or something like the secret_service api. The way it's implemented, no API is broken but the possibility to reuse the credentials is there. #### Why do I wan't this? When using librespot without the cache, Spotify will send an email about a new login attempt when using the password credentials, with the long-lived token this does not happen. But I don't want to either use the cache or I don't want the token in a json file on my fs. Feel free to give me some feedback or another solution, but I’m relatively new to rust, so I might ask some questions. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 20:01:27 +03:00
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#1173
No description provided.