Type in your question below and we'll check to see what answers we can find...
Loading article...
Submitting...
If you couldn't find any answers in the previous step then we need to post your question in the community and wait for someone to respond. You'll be notified when that happens.
Simply add some detail to your question and refine the title if needed, choose the relevant category, then post.
Before we can post your question we need you to quickly make an account (or sign in if you already have one).
Don't worry - it's quick and painless! Just click below, and once you're logged in we'll bring you right back here and post your question. We'll remember what you've already typed in so you won't have to do it again.
Please see below the most popular frequently asked questions.
Loading article...
Loading faqs...
Please see below the current ongoing issues which are under investigation.
Loading issue...
Loading ongoing issues...
Hey Spotify,
I'm using your authentication api to register all my users and everything worked fine since yesterday. I just launced a big ad campaign and suddenly no new users or current ones can sign in and all the api returns are: 400 - 'invalid_request' without any error description or ENOTFOUND accounts.spotify.com. This happens when I'm requesting the authorization_code via: https://accounts.spotify.com/api/token.
But as I said everything worked fine since yesterday.
What is wrong?
I sincerely hope you can help me out. I'm losing users by the minute.
Regards,
Anker
Me too. I'm getting an authorisation code but not able to swap it for an access token. What is the response you guys see? is it similar to this =>
{'error': 'invalid_request', 'error_description': ''}
@Spotify you are a brilliant company, with an amazing bunch of dev friendly APIs but please fix this asap coz we be crapping our pants 😛
@Spotify and @SpotifyJosh,
15 hours have gone by and still, nothing has happened. The error is still occurring and while I'm trending on the danish App Store none of my new users can sign up nor sign in. This is catastrophic for my whole startup. I sincerely hope you can help get this resolved asap as I'm having an event in a couple of hours with 1000's of new users. Please help.
Regards,
Anker
Hi @ankerbachryhl. Sorry to hear about the difficulty you have been having here. The OAuth endpoints are working normally, from what we can see. Are you receiving the ENOTFOUND error most often, or are you receiving the 400 series error more often? Is your app open source by chance?
Hi @spotifyjosh
Thank you for your reply. I'm afraid my app is not open source, but I can provide a detailed description here.
Today I'm receiving the 400 error most often. I receive the error with the following response: { error: 'invalid_request', error_description: '' }
I'm only receiving the error when I try to call the https://accounts.spotify.com/api/token endpoint with the grant_type of "authorization_code". Every other web API call is working as usual and I'm able to receive the authorization code too. It's only when trying to get the token it fails.
Here is my full call:
axios({
url: "https://accounts.spotify.com/api/token",
method: "post",
crossDomain: true,
params: {
grant_type: "authorization_code",
code: code,
redirect_uri: redUrl,
client_id: CLIENT_ID,
client_secret: CLIENT_SECRET,
},
headers: {
"Content-Type": "application/x-www-form-urlencoded",
},
});
And here is the error:
method: 'POST',
path: '/api/token?grant_type=authorization_code&code=AQBi3r8CLkJfD7ZgLyKp17l1ltNcPlA_igKjMyvk0tovAMC3TquRyyWfTVE7EKv98sw2IshZHNldm_IKnIZwFA2nC6ZRA6SIXRV_HiZKV14pcOBhO-33gXQdo70zMYaL6-dkTGhnqgNR0Q2tKWI3bd8CH_8faWaOnK2FKheYrvHWUf3OpgxjxtEHg5B2OS4dXW7PopoicQJhEDCBEbBKExfJDT9KQcAG8PaGNUPLKQVtYhurXBuN_eDBSmWK3Ck1JBrRzIiUBnZPkj8kyi19yXVd1mYdghlBFXAqKot7tEM97ZBwmVxSnq9ESdHBdSEXZnJMgYuWZBz6oX_99auPK3KA0nn_pnMfZCc2DFex75DxemPXag7cfIsRlJCheDc064dm0PVJKtRyfV0ok6i7EaS46Fd_9x-8dIyjEmvG8GuxEEJ-DQ85X1I5JSwXlJgN5natsBX8IBFWQizj&redirect_uri=https:%2F%2Fauth.expo.io%2F@ankerbachryhl%2Fqueue-app&client_id=01f3050a33d549ac93e44ff41727ae1a&client_secret=d5785527ce0045559f50c0d335642964',
_ended: true,
res: [IncomingMessage],
aborted: false,
timeoutCb: null,
upgradeOrConnect: false,
parser: null,
maxHeadersCount: null,
_redirectable: [Writable],
[Symbol(kNeedDrain)]: false,
[Symbol(isCorked)]: false,
[Symbol(kOutHeaders)]: [Object: null prototype]
},
data: { error: 'invalid_request', error_description: '' }
},
As I said earlier everything was working fine up until 3pm yesterday where I received the 400 error for the first time. It has then failed since. I have not changed any code or done any server work. Hence why I believe it must be an error on the Spotify API OAuth side.
Hi @spotifyjosh
Thank you for your reply. I'm afraid my app is not open source, but I can provide a detailed description here. I can't include any code here though, since everytime I try it gets marked as spam and my message gets deleted. So please provide an e-mail if you need my API calls.
Today I'm receiving the 400 error most often. I receive the error with the following response: { error: 'invalid_request', error_description: '' }
I'm only receiving the error when I try to call the https://accounts.spotify.com/api/token endpoint with the grant_type of "authorization_code". Every other web API call is working as usual and I'm able to receive the authorization code too. It's only when trying to get the token it fails.
As I said earlier everything was working fine up until 3pm yesterday where I received the 400 error for the first time. It has then failed since. I have not changed any code or done any server work. Hence why I believe it must be an error on the Spotify API OAuth side.
I hear you - that sounds frustrating @ankerbachryhl. We have some open source code samples that use the authorization code flow. Have you tried remixing this Glitch sample app? It might be that you can compare this implementation with your app and find the problem that way.
hey @spotifyjosh. This seemed to be working perfectly until yesterday. Absolutely nothing has changed in the code from our end. We've checked everything. the client id, secret, scopes, urls.We also are able to get an authorisation code but token swap is failing. Also played around with different accounts but to no avail. I seem to be consistently getting the following error : {'error': 'invalid_request', 'error_description': ''}. What's peculiar is that there is no description. While we are not in the anxious predicament that @ankerbachryhl finds himself in, it is nonetheless frustrating since our dev work has been put on hold.
I am experiencing the same thing since yesterday. We haven't changed anything either. After we get the code from the call to /authorize, I get the following when exchanging it for an access/refresh at /api/token.
{
"error": "invalid_request",
"error_description": ""
}
I can provide some cURLs if that will help with diagnosis.
Hey @rogerchang1 and @rohitganapathy. Are your apps open source? If so, you can link to them in the thread here and I'll take a look. You might also want to try the Glitch sample app that I linked to above. Let me know if this template is not working for you: https://glitch.com/~spotify-authorization-code
I just tried creating another Spotify API App. Which means a new client ID and secret. Still getting the same error. In case that helps
Uhm.
Even de cURL example from the documentation (replaced with correct values) fails with the exact same nondescript error.
Specifically it's the token exchange that fails.
@rogerchang1 wrote:
Could it be possible that react-native-app-auth is passing different parameters to the spotify authorize url causing the code returned to not work?
Yes that could be the problem, @rogerchang1. Spotify does not support PKCE.
@SleeplessByte, welcome to the forum. Which URL parameters did you include in the authorization request URI?
Hey there you, Yeah, you! 😁 Welcome - we're glad you joined the Spotify Community! While you here, let's have a fun game and get…