jonashcroft / Nowify

A Spotify 'Now Playing' screen designed for Raspberry Pi
MIT License
223 stars 415 forks source link

Another case of 'INVALID_CLIENT: Invalid client' #28

Closed ianaitch closed 2 years ago

ianaitch commented 2 years ago

Hi,

I'm kind of new to some of this, so I may have made a dumb error.

I forked Nowify, deployed into Netlify, set up the spotify developer app, copied the client id and secret environment variables into Netlify environment settings. Also copied the URL of my app in Netlify into the redirect URI in the Spotify app. When I go to the Netlify URL I see the correct page image But every time I get this error after clicking login :- image

It looks like I log in, authenticate and then fail.

The URL returned from Spotify is "https://accounts.spotify.com/authorize?client_id=undefined&response_type=code&redirect_uri=https%3A%2F%2F.netlify.app&state=uecd1nl93p6-o8fv91wagf-q3nxdwgkp-fsqelse9&scope=user-read-currently-playing

I looked at the other two issues where Invalid Client was mentioned and neither seemed to give a clue. Any ideas what I missed? I see that Client_Id is blank in the URL above.

All help always gratefully received!

ianaitch commented 2 years ago

(Yeah, the editor here just fiddled with my URL shown above because I tried to replace my URL with . The &redirect_uri I see in the URL is correct, and has the right text before .netlify.app).

ianaitch commented 2 years ago

The correct URL is : https://accounts.spotify.com/authorize?client_id=undefined&response_type=code&redirect_uri=https%3A%2F%2Fmynowify.netlify.app&state=vk8dt2cuub-rvqe1jg42f-0m4c6fqsj-77mjdsyd&scope=user-read-currently-playing This is what errors.

Dherdre commented 2 years ago

Hi,

Did you already found a fix? I have the same problem.

Thanks in advance!

JannisBluu commented 2 years ago

Hey, I have the same problem. May you can help not only one, but directly two, who searches for help ;D

Best regards

jonashcroft commented 2 years ago

Hey! Sorry you've been having trouble with this.

A similar issue was mentioned in #27.

Are any of you able to confirm if this persists after redeploying when you add your keys in?

Dherdre commented 2 years ago

Hi,

That did the trick! Thank you!

JannisBluu commented 2 years ago

At first thanks for the fast support 🥇 Now I have the error message

INVALID_CLIENT: Invalid redirect URI

after clicking on the Log In Button. I´ve added the client key and secret to netflify an deployed it as you describe in #27

Thanks in advance!

jonashcroft commented 2 years ago

That error means that your redirect URI is incorrect.

You need to add the URL of your app within My Applications on Spotify. This is described in the instructions in the dashboard.

The URI must match your own apps URL exactly.

JannisBluu commented 2 years ago

Thank you, now it works. I deleted the uri in spotify and copyed it again, now it works. ♥

jonashcroft commented 2 years ago

Great! Thank you. Closing this.