Skip Menu | You are currently an anonymous guest. | Login | Return to Main | About rt.cpan.org
 

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.

X Report information
Id: 39370
Status: resolved
Left: 0 min
Priority: 0/0
Queue: Flickr-Upload

Owner: CPB <cpb [...] cpan.org>
Requestors: emmajane [...] ubuntu.com
Cc:
AdminCc:

Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



X History Display mode: Brief headersFull headers
#   Wed Sep 17 18:19:22 2008 emmajane[...]ubuntu.com - Ticket created  
Subject: code: Invalid auth token
Date: Wed, 17 Sep 2008 18:18:57 -0400
To: bug-Flickr-Upload[...]rt.cpan.org
From: Emma Jane Hogbin <emmajane[...]ubuntu.com>
[text/plain 819b]
Version: Flickr-Upload-1.31

Although it is very possible I have done something wrong, I have not
gotten error messages in the installation process.

$ flickr_upload --auth --key <api key> --secret <api secret>
generates a URL that Flickr recognizes. I go to Flickr and am able to
accept the authentication. I receive the success message: You have
successfully authorized the application GScrot. You can go ahead and
close this window now.

When I press enter back at the command line I am issued an
authentication token. It is 17 numbers-16 alphanumeric characters.

$ flickr_upload --auth_token <token> screenshot_03.png

and receive the following error message:
Uploading screenshot_03.png...upload failed:
<?xml version="1.0" encoding="utf-8" ?>
<rsp stat="fail">
<err code="98" msg="Invalid auth token" />
</rsp>

#   Wed Sep 17 19:08:03 2008 CPB - Taken  
#   Wed Sep 17 19:13:11 2008 CPB - Correspondence added  
[text/plain 720b]
This may be something to highlight in the documentation...

You're generating the authentication token against your own key and
secret:

> $ flickr_upload --auth --key <api key> --secret <api secret>

But you're uploading using the Flickr::Upload key and secret:

> $ flickr_upload --auth_token <token> screenshot_03.png

The authentication token is only valid against a specific app/secret
combination.

So you either need the --key and --secret options on the upload itself,
as well, or if you're lazy like me you'll put it all into a .flickrrc
file:

cat >>~/.flickrrc
key=<api key>
secret=<api secret>
auth_token=<token>
^D

At which point, you should be able to just do:

flickr_upload screenshot_03.png
#   Wed Sep 17 19:13:13 2008 RT_System - Status changed from 'new' to 'open'  
#   Wed Sep 17 19:27:04 2008 emmajane[...]ubuntu.com - Correspondence added  
Subject: Re: [rt.cpan.org #39370] code: Invalid auth token
Date: Wed, 17 Sep 2008 19:26:50 -0400
To: bug-Flickr-Upload[...]rt.cpan.org
From: Emma Jane Hogbin <emmajane[...]ubuntu.com>
[text/plain 578b]
Christophe Beauregard via RT wrote:
> This may be something to highlight in the documentation...

Yes, please!

>> $ flickr_upload --auth_token <token> screenshot_03.png

Changing this to include the --key and --secret from flickr:

$ flickr_upload --auth_token <token> \
--key <api key> --secret <api secret> \
'file.jpg'

makes it WORK! Excellent, thanks very much!

My hope is to incorporate Flickr::Upload into GScrot (a GNOME screen
shot app written in perl). The first step was understanding how it
actually all works, which flickr_upload is helping with. Thanks again!

#   Wed Sep 17 20:29:07 2008 CPB - Correspondence added  
[text/plain 450b]
On Wed Sep 17 19:27:04 2008, emmajane[...]ubuntu.com wrote:
> Christophe Beauregard via RT wrote:
> > This may be something to highlight in the documentation...
>
> Yes, please!

Added a brief blurb to the discussion of the --key and --secret options
which should help clear that up. Also added a --check option to invoke
Flickr's checkToken method so you/I can test without trying to upload a
picture. Flickr::Upload 1.32 is heading to CPAN as I type.

#   Wed Sep 17 20:29:09 2008 CPB - Status changed from 'open' to 'resolved'