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

Auth Loop Fails... #27

Closed
kitplummer opened this issue Nov 6, 2014 · 9 comments
Closed

Auth Loop Fails... #27

kitplummer opened this issue Nov 6, 2014 · 9 comments
Labels

Comments

@kitplummer
Copy link

Running into same error on two different machines, after updating to 5.1.

There was an error during the authentication (exception exception 'SpotifyWebAPI\SpotifyWebAPIException' with message 'Invalid client' in /Users/kplummer/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.42603F07-9CED-4C3D-AEFD-ABD8FCB867E0/vendor/jwilsson/spotify-web-api-php/src/Request.php:120 Stack trace: #0 /Users/kplummer/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.42603F07-9CED-4C3D-AEFD-ABD8FCB867E0/vendor/jwilsson/spotify-web-api-php/src/Request.php(23): SpotifyWebAPI\Request->send('POST', 'https://account...', Array, Array) #1 /Users/kplummer/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.42603F07-9CED-4C3D-AEFD-ABD8FCB867E0/vendor/jwilsson/spotify-web-api-php/src/Session.php(211): SpotifyWebAPI\Request->account('POST', '/api/token', Array) #2 /Users/kplummer/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.42603F07-9CED-4C3D-AEFD-ABD8FCB867E0/callback.php(66): SpotifyWebAPI\Session->requestToken('AQDIgEL2tbLPQJ5...') #3 {main})

@vdesabou
Copy link
Owner

vdesabou commented Nov 6, 2014

Hi,

The error is "Invalid client". Are you sure you set the right Client Id that is on your Application page, and the right Client Secret ?
To me it looks like it does not correspond to your application, see info here https://github.com/vdesabou/alfred-spotify-mini-player/wiki/First-time-use

To do configuration again, type "spot_mini_debug" and then choose "Browse to app support folder". In there, delete the file settings.db

Then at next invocation it will ask for Client ID, secret again.

@kitplummer
Copy link
Author

Ah, I was missing the Client Secret step. Works fine if I set the Secret to the appropriate values. Sorry for that.

@kitplummer kitplummer reopened this Nov 6, 2014
@kitplummer
Copy link
Author

Hrm. On one machine, where the mini player was working before, I've been able to update. On a clean machine, the auth process never asks for the Secret...just goes straight from ClientID to starting the authentication loop.

@vdesabou
Copy link
Owner

vdesabou commented Nov 6, 2014

On one machine, where the mini player was working before, I've been able to update. On a clean machine, the auth process never asks for the Secret...just goes straight from ClientID to starting the authentication loop.

Strange..Should not happen, it means the secret is set in settings.db. Can you please delete settings.db on this machine as explained before and try gain?

If this doesn't work, send me the debug TGZ file generated

@kitplummer
Copy link
Author

Ok, did. After the Client ID submission, the next step was to submit the Secret, which was populated with the Client ID. I never got an opportunity to paste the Client Secret.

@vdesabou
Copy link
Owner

vdesabou commented Nov 7, 2014

After the Client ID submission, the next step was to submit the Secret, which was populated with the Client ID

I don't get the 'which was populated with the Client ID'. Is that you who populated it ? I really don't see how a step can be missed, unless the user entered something by mistake.

Can you download the latest version 5.1.1, I've added some validations for the authentication process, it should help.

Also I've added a command spot_mini_reset in order to easily reset settings and start again the authentication problem.

Please keep me posted, I would like to understand why you have some many troubles with this authentication part

@kitplummer
Copy link
Author

Cool. Thanks for the help, and work on this great tool!

So here's the flow. I started with a reset.

Then, I 'Alfred' to the Spot Mini Player and it gets me to where it asks to submit my Client ID, which I then paste in and hit enter. Alfred goes away, and when I reopen it and go to Spot Mini Player the Client Secret dialog comes up, but prepopulated with the Client ID.

https://www.dropbox.com/s/tdnbrd3vrxn5pec/Screenshot%202014-11-07%2007.37.39.png?dl=0

If I remove the Client ID and paste in the Client Secret the auth loop works as expected. I believe what was happening before is that Client ID was getting submitted as the Client Secret with out me getting prompted for the Secret. Make sense?

@vdesabou
Copy link
Owner

vdesabou commented Nov 7, 2014

I think I start to understand. I believe you have this option in Alfred 'Show latest history if within 5 minutes' (in advanced prefs) ?

And you call the workflow using 'spot_mini' ?

I personally never invoke the workflow like, I prefer the following hotkeys:
capture d ecran 2014-11-07 a 15 49 46

When a workflow is invoked via hotkeys, the history is not retrieved, hence I did not see the problem.

To go back to your problem, now it shall be resolved with 5.1.1, because if you have application secret entered being the same as the client Id (which is the case when last command from history is set), then you have the following error:

capture d ecran 2014-11-07 a 15 50 59

@vdesabou vdesabou reopened this Nov 7, 2014
@kitplummer
Copy link
Author

Yes, I do have the show history enabled. Oh, cool...more hotkeys! Thanks again.

@vdesabou vdesabou closed this as completed Nov 7, 2014
@vdesabou vdesabou added the bug label Feb 12, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants