Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement login dialog #1

Closed
hrkfdn opened this issue Mar 2, 2019 · 11 comments
Closed

Implement login dialog #1

hrkfdn opened this issue Mar 2, 2019 · 11 comments
Labels
enhancement New feature or request

Comments

@hrkfdn
Copy link
Owner

hrkfdn commented Mar 2, 2019

Requiring new users to create a configuration themselves is not user-friendly.

Create a dialog asking for Spotify credentials on startup/when login credentials are missing.

@hrkfdn hrkfdn added the enhancement New feature or request label Mar 2, 2019
@Herbstein
Copy link
Contributor

Does this way of doing it even work with accounts created through Facebook?

@hrkfdn
Copy link
Owner Author

hrkfdn commented Mar 3, 2019

More info for future reference: librespot-org/librespot#244

@medwards
Copy link
Contributor

medwards commented Mar 11, 2019

There is a workaround for facebook auth: Go to your Spotify account settings and go to something like "Set Device Password"

The password entered there can be put into ncspot's config file.

I've also been working on getting the third party auth flow to work with Facebook in medwards/ncspot/master, but I'm not sure how to debug my crash. ncurses seems to take over, flash something to the terminal, then wipe it before exiting with code 101. My guess is there is some auth related unwrap in some thread and it brings the entire thing down, but I'm not sure how to debug this. Will gdb or cgdb play nicely with ncspot?

You can reproduce by creating a .config/ncspot file with no password and an empty or junk auth field.

@hrkfdn
Copy link
Owner Author

hrkfdn commented Mar 11, 2019

You can log the backtrace to a file like so: RUST_BACKTRACE=full cargo run 2> stderr.log

@medwards
Copy link
Contributor

Thanks, that was helpful. I assumed ncurses would somehow capture stderr.

I got my hacky approach to work: medwards/ncspot@f9af3bb

My ideal final version has librespot updating to serde 1.0 and then .config/ncspot is expected to be a toml serialized librespot Credentials struct

medwards added a commit to medwards/ncspot that referenced this issue Mar 24, 2019
medwards added a commit to medwards/ncspot that referenced this issue Mar 24, 2019
medwards added a commit to medwards/ncspot that referenced this issue Mar 24, 2019
medwards added a commit to medwards/ncspot that referenced this issue Mar 27, 2019
medwards added a commit to medwards/ncspot that referenced this issue Mar 29, 2019
@hrkfdn hrkfdn closed this as completed in d78e718 Mar 30, 2019
@krflol
Copy link

krflol commented Apr 8, 2020

I may be in the minority, but I preferred username/password in config (multiple terminals. Easier to copy) I noticed an auth type parameter in the .toml but can't find documentation. Is this doable?

@ghost
Copy link

ghost commented Jun 18, 2020

thread '<unnamed>' panicked at 'Authentication failed with reason: PremiumAccountRequired', /root/.cargo/registry/src/github.com-1ecc6299db9ec823/librespot-core-0.1.1/src/connection/mod.rs:121:21 note: run with RUST_BACKTRACE=1environment variable to display a backtrace Didn't obtain any credentials
It doesn't allow to login on with Facebook and Spotify Account.

@hrkfdn
Copy link
Owner Author

hrkfdn commented Jun 18, 2020

PremiumAccountRequired

Do you have a premium account?

@Calamigos
Copy link

I may be in the minority, but I preferred username/password in config (multiple terminals. Easier to copy) I noticed an auth type parameter in the .toml but can't find documentation. Is this doable?

Can the credentials.json file be edited to include creds instead of logging in via prompt?

@medwards
Copy link
Contributor

medwards commented Feb 8, 2022

The credentials file is is just a serialization of librespot::Credentials to ~/.cache/ncspot/librespot/credentials.json.

I don't know that you can trivially write this file (auth_data is some kind of token not your password), but you should be able to copy it between machines after creating it once.

@Bettehem
Copy link
Contributor

Bettehem commented Feb 9, 2022

The credentials file is is just a serialization of librespot::Credentials to ~/.cache/ncspot/librespot/credentials.json.

I don't know that you can trivially write this file (auth_data is some kind of token not your password), but you should be able to copy it between machines after creating it once.

I can confirm that copying the file between machines works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants