Spotify Web API won't work for a specific user? - spotify

I'm trying to use the web api to query a user's playlists (using the spotipy Python library). I got the user to oAuth in, got an access token, made the request and got a 500 error:
SpotifyException: http status: 500, code:-1 - https://api.spotify.com/v1/users/125139403/playlists?limit=50&offset=0: Server error.
I then tried the same request in Web API test console and it worked fine.
But then things get kind of weird. I tried running the cURL command the console generated in a terminal and got the same 500 error.
Then I tried running the same request using cURL but just changing the username in the URL and it worked fine (at least for public playlists) for both my username and a random friend's user ID number.
I thought maybe I'm having a token issue but the token I'm using seems to work fine with other usernames. It's just the one specific user for whom I'm getting the error.
I'd rather not post the user's ID on this public forum but I can email it to someone if it's relevant.
My best guess for what's wrong at this point is a bug on Spotify's side but I certainly could be doing something wrong.

Again, thanks for reporting this. This bug was fixed by Matt M. and was just deployed to production.
Please try it out in our API Console. (which Matt was also part of building!)

Related

Randomly getting a login prompt

I am randomly getting a login prompt asking me to log in to localhost:3000 while working on my project (in localhost). Sometimes it does not show up the whole day and next morning I get 10 prompts in a row (canceling through pressing escape), and then it starts working properly again.
These are the errors I get in the console when it has been canceled:
I suspect one of the following, but really I have no idea:
Webpack is not configured correctly
There is some resource that requires authentication (but I can't figure out which), I am running everything on localhost
There is something wrong with the node.js server thingy...
Any tips on what might be going on are very welcome.
Edit: My backend is mocked in localhost.
Edit 2: I found this: Receiving login prompt using integrated windows authentication and it is possible that the thing that is causing the error is some faulty configuration in my IIS. But it is difficult to verify since it only shows up randomly.
Webpack has nothing to do with your API calls.
401 errors are due to auth credentials failing.
It means that your backend ask you to update your token(s) used for auth in API calls.

Instagram API Matching code was not found or was already used

I am seeing this error from my live server using the Instagram API.
{
"Error":true,
"message":"Matching code was not found or was already used."
}
I have read a few suggestion on here to clear cache but that isn't fixing the issue. I am also unable to submit a support ticket directly on the Instagram site as I am receiving an error message while attempting to submit a ticket.
There are a bunch of developers complaining about the same issue at https://news.ycombinator.com/item?id=13178789. I don't think unchecking "Disable implicit OAuth" fixes the issue as I have already tried that and it didn't work.
The best thing you can do is to submit a report to instagram using your client id to put some pressure on their side to fix this issue.
I have the same issue, I guess it's from Instagram I reported an issue from my client panel in developer > manage clients > Report issue.
You can do they resolve this issue as soon as possible.
There is definitely a problem with the Instagram OAuth flow. The returned authorization code doesn't seem to work for some reason, it's very likely a network related problem that they need to fix on their end.
My theory is that the authorization code generated is not distributed to all Instagram API servers, and if you happen to hit a bad node then you're out of luck.
However, I recently found a solution that doesn't rely on the authorization code. If you use the client-side authentication then you'll be able to retrieve the access token without ever using the authorization code. It's less secure but works great as a temporary fix.
You simply change response_type=code to response_type=token. The token response type will redirect the user back to your website using this URL structure:
http://your-redirect-uri#access_token=ACCESS-TOKEN
I recommend fetching the access token from the URL client-side using JavaScript, and then passing it to an endpoint on your website. E.g. /callback?accesstoken={accessToken}. This is required because the content in the hash is not passed to the server.
Example:
<script>
if (window.location.hash && window.location.hash.indexOf('#access_token=') !== -1) {
var accessToken = window.location.hash.replace('#access_token=', '');
window.location.href = '/callback?accesstoken=' + accessToken;
}
</script>
The code snippet above is copied and slightly modified from the solution at https://news.ycombinator.com/item?id=13178789
You can read more about Instagram client side authentication on https://www.instagram.com/developer/authentication/ under Client-Side (Implicit) Authentication
I just had the same issue. Not sure why, but for me the code returned from oauth/authorize/? had 2 special characters at the end - "#_". After removing these my code worked.
This is due to security restrictions in place on your Instagram app. You can choose to allow it by unchecking "Disable implicit OAuth" for your Instagram app, under the Security tab.

passport-facebook node app doesn't seen to work

https://www.facebook.com/dialog/oauth?response_type=code&redirect_uri=https%3A%2F%2Fpanorart-victor3991.c9users.io%2Fauth%2Ffacebook%2Fcallback&scope=emails&client_id=547453695448009
My app is still under development.
It used to work with facebook login. But it suddenly got to the 500 error with the text:
Sorry, something went wrong.
We're working on getting this fixed as soon as we can.
I thought this might be the facebook internal network error but the issue had been on for almost a month.
Does anyone have some idea why it's happening?
I'm also using google oauth with similar logic and it's working fine.
For me it was the scope passed via passport that was incorrect. I used the google scope which was profile and email, whereas facebook required publish_actions. Hope this helps

Retrieve BLOGS_UPLOADED_IMAGES in java

I have some java code that retrieves blogs through the REST API's. I am not using the social business toolkit, but we have our own framework for that.
The application works perfectly on an on-premise connections environment and has worked on multiple versions.
However when switching to Connections Cloud, some parts stopped worked.
We get a 403 - Forbidden exception on 2 occasions:
Getting the details of a blog post: /blogs/[blog-id]/feed/entry/atom?entryid=[entry-id]
Getting images inside the blog post: /blogs/[blog-id]/resource/BLOGS_UPLOADED_IMAGES/[image file name]
I have fixed issue 1) by switching to the plublishing API: /blogs/[blog-id]/api/entries/[entry-id].
I cannot find a way to fix issue 2). I have also found 2 other image urls:
https://apps.ce.collabserv.com/blogs/[blog-id]/api/media/[file-name]
https://apps.ce.collabserv.com/blogs/[blog-id]/api/media/BLOGS_UPLOADED_IMAGES/[file-name].media
Both return:
<sp_0:error xmlns="http://incubator.apache.org/abdera" xmlns:sp_0="http://incubator.apache.org/abdera">
<code>404</code>
<message>Not Found</message>
</sp_0:error>
I want to authenticate by using Basic Authentication when possible. This does not appear to work with the given 403 urls.
My guess is that this the basic authentication header is not picked up. I have seen this before.
I used to fix this by first calling another URL that does support basic authentication and using the Ltpa cookies to authenticate the image url.
This also does not work: I do get LtpaTokens, but when I pass all the cookies to the URL, the image still does not work.
I prefer not to use OAuth of OAuth 2 at this moment. Is there any other way to fix this?
Anybody else managed to retrieve BLOGS_UPLOADED_IMAGES?
The issue is can also be reproduced in a browser.
Make sure you are not yet authenticated and the blog has posts with
images
Go to /blogs/[blog-id]/api/media
Authenticate using the popup in the browser The Atom feed now appears. This contains the images of your blog.
403 when opening:
/blogs/[blog-id]/resource/BLOGS_UPLOADED_IMAGES/[image]
404 xml when opening: /blogs/[blog-id]/api/media/* links

TokenError: Code was already redeemed - Passport Google OAuth

I am trying to auth my app with passportjs using email strategy.
However I always get code redeemed error. I found out that callback is being called 2 times (we see it on wireshark logs).
I opened a ticket on GitHub
https://github.com/jaredhanson/passport-google-oauth/issues/105
Looks like it works fine for most people, but not for me.
So I'm looking for people who have experience of fixing it.
There is no need to paste source here as long as it's exactly the same code provided in examples for passportjs
I managed to get it working by using external ip address and specifying it for google callback url.

Resources