mirror of
https://github.com/ramsayleung/rspotify.git
synced 2026-04-26 07:55:55 +03:00
[GH-ISSUE #130] Introduce automatic token retrieval #44
Labels
No labels
Stale
bug
discussion
enhancement
good first issue
good first issue
help wanted
pull-request
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/rspotify#44
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?
Originally created by @hypixus on GitHub (Sep 25, 2020).
Original GitHub issue: https://github.com/ramsayleung/rspotify/issues/130
This is a feature request.
This project works perfectly, but as I'm trying to create application where user interacts only with generated GUI, i'm in no way capable of providing the URL user is redirected to after allowing application to use their data - because command line is off the limits, and this is hardcoded into the library ("Enter the URL you were redirected to: ")
A very simple solution would be implementing http server going with localhost:, where user is redirected to and application is just reading the data off the request directly (just like in Listing 20-2 on rust cookbook).
If this is already implemented/has a possible workaround without rebuilding entire library, please let me know - I'll close the issue immediately.
@marioortizmanero commented on GitHub (Sep 25, 2020):
This was being discussed at #4. I don't think that implementing a server is something this library should do, that's part of the user's implementation. The
examples/webappexample covers this more or less, so you might want to take a look.@hypixus commented on GitHub (Sep 25, 2020):
I understand what you mean, yet having this hardcoded leaves user in need of rebuilding entire library to suit his needs - which is what i tried to avoid at first. Having limited rust knowledge leaves me with little to none understanding of example provided, but seeing its a matter of replacing a few lines and compiling thing on my own it sounds simple enough to do myself. Thanks for your time, closing.
@marioortizmanero commented on GitHub (Sep 25, 2020):
What is hardcoded? You can still get access tokens without the stdin method.
get_tokenis just an utility for the CLI apps: https://github.com/ramsayleung/rspotify/blob/v0.9/src/util.rs#L94. This is going to be refactored for the next release but the concept will be the same. I strongly recommend you to learn enough Rust to understand the example I linked you, as it's basically the same thing as what you're talking about.@hypixus commented on GitHub (Sep 25, 2020):
That's what my understanding lacked. Having spent last hour on understanding line by line, I understand now that it can be used without changing library at all. Thanks once more!
@marioortizmanero commented on GitHub (Sep 25, 2020):
I will confess the documentation leaves to be desired. Hopefully the next release will improve that :) If you have any more suggestions do let us know.