cinohub / flickrj-android

Automatically exported from code.google.com/p/flickrj-android
Other
0 stars 0 forks source link

On certain environments, Photo Upload results in 401 response: oauth_problem=signature_invalid #3

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Test Upload Photo with any of the following environments:

a) java version "1.6.0_20"
    OpenJDK Runtime Environment (IcedTea6 1.9.8) (rhel-1.39.1.9.8.el6_1-i386)
  OpenJDK Client VM (build 19.0-b09, mixed mode) 

b) jre version 1.6.0_26-b03 on windows.
c) Some other linux versions on Amazon cloud servers.

Actually I have tried in many different environments and it has never succeeded 
on a Linux machine. It has worked fine on some Windows machines. 
And on one particular machine, it works with the java inside the jdk folder, 
but fails with the java in JRE folder. These two versions are both 1.6.0 and 
differ only in minor versions

What is the expected output? What do you see instead?
Expected: Successful Upload
Actual: 401 response: oauth_problem=signature_invalid 

What version of the product are you using? On what operating system?
flickrj-android-1.0.0.20111015103854.jar on Windows and Linux as mentioned above

Please provide any additional information below.

java.io.IOException: Connection Failed. Response Code: 401, Response Message: 
Unauthorized, Error: 
oauth_problem=signature_invalid&debug_sbs=POST&http%3A%2F%2Fwww.flickr.com%2Fser
vices%2Fupload%2F&async%3D0%26is_family%3D0%26is_friend%3D0%26is_public%3D0%26oa
uth_consumer_key%3DXXXXXXXXXXXXXXX%26oauth_nonce%3DXXXXXXXXXXX%26oauth_signature
_method%3DHMAC-SHA1%26oauth_timestamp%3D1321447214%26oauth_token%3DXXXXXXXXX%26o
auth_version%3D1.0%26title%3DPicture%2520taken%2520by%2520Charu
        at com.gmail.yuyang226.flickr.REST.sendUpload(REST.java:260)
        at com.gmail.yuyang226.flickr.Transport.upload(Transport.java:86)
        at com.gmail.yuyang226.flickr.uploader.Uploader.upload(Uploader.java:169)

Original issue reported on code.google.com by ankit.si...@itaas.com on 18 Nov 2011 at 5:05

GoogleCodeExporter commented 8 years ago
On both Linux and Windows, it works with java 1.6.0
and does not work with 1.6.0_20 onwards

Original comment by ankit.si...@itaas.com on 18 Nov 2011 at 6:51

GoogleCodeExporter commented 8 years ago
You need to make the following changes:
1) Uploader.Uploader(String apiKey, String sharedSecret):

this.transport = new REST(Flickr.DEFAULT_API_HOST);

2) REST.writeParam

//@SuppressWarnings("unused")
                int res = -1;
                while ((res = in.read(buf)) != -1) {
                    out.write(buf,0,res);
                }

Original comment by ankit.si...@itaas.com on 18 Nov 2011 at 12:28

GoogleCodeExporter commented 8 years ago
Thanks ankit.sinha@itaas.com, the issue has been fixed per your suggestion. 
Please re-download the latest version from 
https://code.google.com/p/flickrj-android/downloads/list

By the way, I am very sorry for the delay, as this is just my part time job and 
I have been very busy with my daily work recently. 

Original comment by yuyang...@gmail.com on 24 Dec 2011 at 11:37