[GH-ISSUE #417] Auth code flow, redirect server. #140

Closed
opened 2026-02-27 20:23:21 +03:00 by kerem · 4 comments
Owner

Originally created by @blueforesticarus on GitHub (May 26, 2023).
Original GitHub issue: https://github.com/ramsayleung/rspotify/issues/417

Is your feature request related to a problem? Please describe.
In the auth code flow, it is inconvenient have to paste the redirect url in the terminal. This is obviously an issue if the program might not be run in a interactive shell.

Describe the solution you'd like
A convenience method like prompt_for_token but which spins up a local server listening to the redirect url, using it to get the code semi-automatically. Ideally should take allow multible redirect_urls (which spotify supports) as fallback (in case port is in use, for example). prompt_for_token could be used as a final fallback.

Describe alternatives you've considered
The obvious solution is to implement the above in my own code. However, I believe it is a common enough use-case to justify putting a convenience method in rspotify. Why have everyone duplicating effort.

Additional context
Willing to implement this (I will have to do it for my program anyway.) Open to suggestions on what http server crate to use.

Originally created by @blueforesticarus on GitHub (May 26, 2023). Original GitHub issue: https://github.com/ramsayleung/rspotify/issues/417 **Is your feature request related to a problem? Please describe.** In the auth code flow, it is inconvenient have to paste the redirect url in the terminal. This is obviously an issue if the program might not be run in a interactive shell. **Describe the solution you'd like** A convenience method like `prompt_for_token` but which spins up a local server listening to the redirect url, using it to get the code semi-automatically. Ideally should take allow multible redirect_urls (which spotify supports) as fallback (in case port is in use, for example). prompt_for_token could be used as a final fallback. **Describe alternatives you've considered** The obvious solution is to implement the above in my own code. However, I believe it is a common enough use-case to justify putting a convenience method in rspotify. Why have everyone duplicating effort. **Additional context** Willing to implement this (I will have to do it for my program anyway.) Open to suggestions on what http server crate to use.
kerem 2026-02-27 20:23:21 +03:00
Author
Owner

@ramsayleung commented on GitHub (May 26, 2023):

I think this issue is similar with this discussion: https://github.com/ramsayleung/rspotify/discussions/365

<!-- gh-comment-id:1564585705 --> @ramsayleung commented on GitHub (May 26, 2023): I think this issue is similar with this discussion: https://github.com/ramsayleung/rspotify/discussions/365
Author
Owner

@github-actions[bot] commented on GitHub (Nov 23, 2023):

Message to comment on stale issues. If none provided, will not mark issues stale

<!-- gh-comment-id:1823740564 --> @github-actions[bot] commented on GitHub (Nov 23, 2023): Message to comment on stale issues. If none provided, will not mark issues stale
Author
Owner

@gdesmott commented on GitHub (Dec 27, 2024):

A convenience method like prompt_for_token but which spins up a local server listening to the redirect url, using it to get the code semi-automatically.

librespot-oauth is doing exactly that: https://github.com/librespot-org/librespot/blob/dev/oauth/src/lib.rs

<!-- gh-comment-id:2563518689 --> @gdesmott commented on GitHub (Dec 27, 2024): > A convenience method like `prompt_for_token` but which spins up a local server listening to the redirect url, using it to get the code semi-automatically. `librespot-oauth` is doing exactly that: https://github.com/librespot-org/librespot/blob/dev/oauth/src/lib.rs
Author
Owner

@ramsayleung commented on GitHub (Jan 5, 2025):

Closing this ticket as this feature has been implemented in this PR: https://github.com/ramsayleung/rspotify/pull/513

<!-- gh-comment-id:2571467894 --> @ramsayleung commented on GitHub (Jan 5, 2025): Closing this ticket as this feature has been implemented in this PR: https://github.com/ramsayleung/rspotify/pull/513
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/rspotify#140
No description provided.