1

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:

  1. Getting the details of a blog post: /blogs/[blog-id]/feed/entry/atom?entryid=[entry-id]
  2. 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.

  1. Make sure you are not yet authenticated and the blog has posts with images
  2. Go to /blogs/[blog-id]/api/media
  3. Authenticate using the popup in the browser The Atom feed now appears. This contains the images of your blog.
  4. 403 when opening: /blogs/[blog-id]/resource/BLOGS_UPLOADED_IMAGES/[image]
  5. 404 xml when opening: /blogs/[blog-id]/api/media/* links

0 Answers0