Token API CORS error

Reply

Token API CORS error

daniel_kim
Casual Listener

Hi.

 

I am building a web application consuming Spotify API.

The feature is simply searching for a song which had worked fine until yesterday.

 

However, all of a sudden I was not able to get a access token from the API server any more - which lead the search request not to work as well. The error message is as below.

 

Access to XMLHttpRequest at 'https://accounts.spotify.com/api/token' from origin 'https://(my site name)' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

 

I just cannot understand why this happens although any line of my codes has not been changed at all. Please give me some possible solutions and updates. Thanks.

 

Best,

Kim.

14 Replies

spotifyjosh
Spotify
Spotify

Thanks for reporting this, @daniel_kim. Are you still seeing the issue now? If so, it would be great if you can share a link to your app, and information about which browser you're using.

nightbreak
Casual Listener
Just did a quick test and it seems to be working for me now as well. Thank you.

dadMau5_
Music Fan

Hi there, 

 

I this morning everything seem to get back to normal at least on my web app... tested in the external public web app that I have and also through localhost with none of the issues happening over the last two days or so. 

 

We are wondering if there was probably something on the API's end that caused these errors to start happening because as daniel_kim mentioned, the errors started happening without changes on our end. 

skaz_fanatsky
Casual Listener

The exact same issue, hope it gets looked at soon

dadMau5_
Music Fan

Looks like it got addressed… no errors this morning for me. With no code changes in my end. 

dadMau5_
Music Fan

This morning the api started working as expected on its own. No code changes at all have gone in and the full functionality on my web app is working now. 

I’d love to hear from the Spotify team about what happened. 

neveroriginal
Casual Listener

Same issue here. Built a project in recent months that uses Spotify's API and it suddenly doesn't work anymore. Subscribing.

fra-mstr
Newbie

My app worked for weeks in this way and I'm getting this error too.

 

It seems that Spotify want you to ask for tokens from server to server, and not from the client.

If they don't fix this issue, I think we should just set up a simple Node/Express server and send the Http request from there.

 

The mystery is that I have been able to ask for token via Ajax for weeks and it always worked until now.

dadMau5_
Music Fan

Same thing here. It appears it’s only the token api. The rest of the web api works fine as long as you already have a valid token. 

Here’s the link to my post: https://community.spotify.com/t5/Spotify-for-Developers/Refresh-Token-API-returning-CORS-errors/td-p...

skaz_fanatsky
Casual Listener

The same issue, the code's been working for at least 2 months and yesterday all of a sudden Spotify started throwing this CORS error. The code is untouched so not sure what changed.

amario
Casual Listener
Hi!
Me and a couple of others have experienced the same problem.
I described it here:
https://community.spotify.com/t5/Spotify-for-Developers/Refresh-Token-API-returning-CORS-errors/td-p...

It looks like we have the exact same problem. Lets hope this gets fixed soon 😄

ehtisham1
Visitor
hi i am having the same issue. Did you guys figure it out yet?

daniel_kim
Casual Listener

Hi.
I’ve sent an inquiry to Spotify team but no updates yet. I’ll let you know here when I get the reply.

dadMau5_
Music Fan

Thanks. Please keep us posted. 

SUGGESTED POSTS