Giter Site home page Giter Site logo

"error":"invalid_client" about spotify-readme HOT 11 CLOSED

tthn0 avatar tthn0 commented on August 23, 2024
"error":"invalid_client"

from spotify-readme.

Comments (11)

 avatar commented on August 23, 2024 1

@M8874 once you deploy your project on VERCEL, you use your project's domain URL, https://spotify-readme-ten-omega.vercel.app/, to reference it in your GITHUB profile homepage README.md like this:

<a href="https://github.com/tthn0/Spotify-Readme">
  <img src="https://spotify-readme-ten-omega.vercel.app/api" alt="Current Spotify Song">
</a>

and that's pretty much it. if you still have problems send me or anyone else who's helping you a separate message because these errors are not related to project bugs, rather personal errors.
so please mark this issue as closed or resolved.

hope these steps were able to resolve your issue.

from spotify-readme.

 avatar commented on August 23, 2024 1

@M8874 add me on Discord, sventripikal, and i will help you through there. but mark this issue as closed please.

from spotify-readme.

tthn0 avatar tthn0 commented on August 23, 2024

Hello @M8874,

Please do not share your Client Secret to the public, even in its Base64 encoded form. I just edited your response to redact it. I recommend that you to regenerate it before trying again. The issue here is that you wrapped curly braces around your Base64 encoded string. Please remove those before making your curl request, and it should work fine. Refer to this example below:

Correct:

-H "Authorization: Basic qJiLwViEYlyviJcMfscrxSuyBFEOkytAsCoonBqzNORhKEtTmEfBTuXOZOZcApyiwXlvvQvSIJfCndZiH="

Incorrect:

-H "Authorization: Basic {qJiLwViEYlyviJcMfscrxSuyBFEOkytAsCoonBqzNORhKEtTmEfBTuXOZOZcApyiwXlvvQvSIJfCndZiH=}"

Additionally, it seems like you mistakenly put a [ as well as a ) in the string for the -d flag in your request. Of course, replace {CODE} (yes, also replace the curly braces) with its respective value, just like with the -H flag above.

Correct:

-d "grant_type=authorization_code&redirect_uri=http://localhost/callback/&code={CODE}"

Incorrect:

-d "grant_type=authorization_code&redirect_uri[=http://localhost/callback/&code={CODE)"

from spotify-readme.

M8874 avatar M8874 commented on August 23, 2024

Thank you for the response. In the example there, I changed 9 characters, don't worry about security.

from spotify-readme.

M8874 avatar M8874 commented on August 23, 2024

Thank you very much @tthn0. I fixed the code, but now I have a new error. I don't know why it occurred, but I've already checked everything. As far as I understand, the error is with the indicator

{"error": "invalid_client", "error_description": "Invalid client"}
curl \
  -X POST \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -H "Authorization: Basic e2MzMmVlMjgxZDc1gyg5NDVlODhiZGNkYjEyMjhhhTE0NzJjjNDIzN2Ez7MGY0ODc1OGJiMzN9" \
  -d "grant_type=authorization_code&redirect_uri=http://localhost/callback/&code=AQA33N-LHY0Y6eW3CJ702_5DtncKsSKXWv7VffgfggertgL3Ws3sgaDhu9uomJhqZxjXVMV9lQlZGhnAORjStOdWuPxhvvoe-_GJr6C9cGocpcCs2SI0u3Au4x3MCmWUlmW4O6oh_b_MUjTu_3ls7Zi58neoGj587xarCpDfXqddeWAX6ydDflKnRIVYaP_RZ-zZte_tExgHUM" \
  https://accounts.spotify.com/api/token

from spotify-readme.

tthn0 avatar tthn0 commented on August 23, 2024

@M8874 For your -H flag that represents authorization, are you sure you encoded your {CLIENT_ID}:{CLIENT_SECRET} correctly? Usually the encoded string should end with an equal sign.

from spotify-readme.

M8874 avatar M8874 commented on August 23, 2024

Hello @tthn0, thanks for your help. I seem to be useless; I can't even complete such a simple task. 😉

from spotify-readme.

M8874 avatar M8874 commented on August 23, 2024

I apologize for such a request; I understand that your time is valuable, and I may be bothering you unnecessarily. Could you please write to me on Telegram at @?

I just want to understand what I'm doing wrong. I want to add a widget to my web portfolio. Currently, there is a widget that is not mine at https://magical-lokum-134348.netlify.app/.

from spotify-readme.

tthn0 avatar tthn0 commented on August 23, 2024

@M8874 I do not use Telegram unfortunately. Are you on Discord? You may add me there; my username is tthn.

from spotify-readme.

 avatar commented on August 23, 2024

@M8874 hello, I just had the same issue but it happened to be that the CALLBACK_CODE that is embedded in the URL when you apply this step https://accounts.spotify.com/authorize?client_id={CLIENT_ID}&response_type=code&scope=user-read-currently-playing,user-read-recently-played&redirect_uri=http://localhost/callback/ actually expires after some time & returning to that step before running the terminal script helped since it gave me a different code to add to the -d &code=. not sure when it actually expires but after redoing that step the script returns the JSON object with the REFRESH_TOKEN you need. hope this helps.

from spotify-readme.

M8874 avatar M8874 commented on August 23, 2024

@SVENTRIPIKAL Hello, thanks for your help. I received the REFRESH_TOKEN, but I still can't get anything to work. https://spotify-readme-ten-omega.vercel.app/

from spotify-readme.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.