mirror of
https://github.com/librespot-org/librespot.git
synced 2026-04-27 08:15:50 +03:00
[PR #1344] [MERGED] Get access token via login5 #1347
Labels
No labels
A-Alsa
SpotifyAPI
Tokio 1.0
audio
bug
can't reproduce
compilation
dependencies
duplicate
enhancement
good first issue
help wanted
high priority
imported
imported
invalid
new api
pull-request
question
reverse engineering
wiki
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/librespot#1347
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/librespot-org/librespot/pull/1344
Author: @photovoltex
Created: 9/19/2024
Status: ✅ Merged
Merged: 10/19/2024
Merged by: @roderickvd
Base:
dev← Head:login5-again📝 Commits (10+)
99f21a1core: Obtain spclient access token using login5 instead of keymaster (Fixes #1179)0ea50e7core: move login5 into own managerf6d032ecore: move solving hashcash into util367b8e3core: login5 handle challenges and errors875d0c0core: add asynchronously lock to componentb923f06login5: add login_context to new followup request1280945core: update versions, add example versions8fdd6fflogin5: add login for mobile0cd125dMerge remote-tracking branch 'origin/dev' into login5-again5e5944acore: revert component changes, pre-acquire tokens📊 Changes
9 files changed (+362 additions, -55 deletions)
View changed files
📝
CHANGELOG.md(+5 -1)📝
connect/src/spirc.rs(+19 -1)📝
core/src/http_client.rs(+2 -0)📝
core/src/lib.rs(+1 -0)➕
core/src/login5.rs(+265 -0)📝
core/src/session.rs(+9 -0)📝
core/src/spclient.rs(+6 -50)📝
core/src/util.rs(+48 -3)📝
protocol/build.rs(+7 -0)📄 Description
As stated in https://github.com/librespot-org/librespot/pull/1220#issuecomment-2353566389 the PR to implement the login5 token retrieval into dev. I couldn't test if solving the
challengeworks, because it didn't send any challenge to solve (i tested it connecting from Android and Linux, so maybe win or osx could do the trick). But if solving thehashcashis universal and solving thehashcashfor theclient_tokenworks, this should as well.The general flow is copied fromgo-librespot.In https://github.com/librespot-org/librespot/pull/1309#issue-2450835186 we already had the problem mentioned with having two solutions to retrieve a token. From the technically viewpoint i would like to remove the
TokenProvidercompletely in favor of login5. But sadly there are some arguments for letting it stay. Compared to login5 the keymaster can provide tokens in relation to a custom client_id. Login5 requests just give aBAD_REQUESTerror if we try do request a token with a custom client_id. I know that some applications likencspotuse this token acquisition to avoid doing the general oauth flow and or storing the client_secret in the application.So i would like some feedback how we should proceed with that problem. It's probably also quite dependent if we still merge this into 0.5 or not?
Fixes https://github.com/librespot-org/librespot/issues/1179
Fixes https://github.com/librespot-org/librespot/issues/1245
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.