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

Can't log in to spotify #105

Closed
AlexEshoo opened this issue Jun 23, 2016 · 8 comments
Closed

Can't log in to spotify #105

AlexEshoo opened this issue Jun 23, 2016 · 8 comments

Comments

@AlexEshoo
Copy link

So maybe I'm missing something here, but when I run the example program and it gives me a link to visit, I get to a log in screen, but when I try to click log in, nothing happens. I can click the log in through facebook link and this logs me in but when I paste it as the redirected link in spotipy, it raises an exception:

    raise SpotifyOauthError(response.reason)
spotipy.oauth2.SpotifyOauthError: Bad Request

Am I doing something wrong? I have my credentials set as environment variables and I'm using http://example.com/callback/ as my redirect uri

@AlexEshoo
Copy link
Author

I found out that its actually logging me in, but not redirecting anywhere. If I put in a bad password it tells me such. but when I put my real password in and click log in, not a thing happens. If I open up the web player in another tab I'm logged in.

@AntonioSerrano
Copy link

Solved it. In order to run the Authorization Code Flow example code provided in the Spotipy's documentation correctly, I specified the redirect URI in line 13 of the example script when calling util.prompt_for_user_token, even when I have done this previously when setting environment variables:

token = util.prompt_for_user_token(username, scope, redirect_uri = 'https://example.com/callback/')

Likewise, do not use https://www.google.com or similar web address as your redirect URI. Instead, try 'https://example.com/callback/' or 'http://localhost/' as suggested here. Do not forget that the redirected URL once you are logged in must have the word code included.

Cheers,
Antonio

@AlexEshoo
Copy link
Author

I've tried what you said, but when I use any of the redirect URIs you suggest the webpage I am brought to has the following message: "INVALID_CLIENT: Invalid redirect URI"
Needless to say, when I past the redirected url in the terminal window I get the same traceback as before.

@nplevitt
Copy link

nplevitt commented Mar 3, 2017

Hey @AlexEshoo, I don't know if you ever figured this out, but I just solved the same problem.

I found that you have to add your redirect URI that you either include in your bash profile or specify directly in the token prompt to your list of redirect URIs directly in the settings for your Spotify Dev App.

@MakonnenMak
Copy link

@nplevitt So I have specified it within my bash , Spotify Dev App, and within my python file. I still get the invalid error, is it due to the fact that I'm using 'https://example.com/callback/' as my redirect uri?

@enriquejosepadilla
Copy link

@AlexEshoo @mmako1

Have you guys been able to figure it out? Below is my code from the examples and i get INVALID_CLIENT: Invalid redirect URI

token = util.prompt_for_user_token(username, scope, client_id=defintions.SPOTIPY_CLIENT_ID, client_secret=defintions.SPOTIPY_CLIENT_SECRET, redirect_uri=defintions.SPOTIPY_REDIRECT_URI)

@enriquejosepadilla
Copy link

nevermind :) Had to whitelist it from spotify dashboard!

@MakonnenMak
Copy link

Apologies for the extremely delayed response, I never received a notification for your comment. For future reference though, whitelisting it fixed it for me too.

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

No branches or pull requests

6 participants