[swx] flickr api keys, secrets and tokens (Hans Elgelid)

Aidann Bowley aidann at ukgateway.net
Wed Oct 31 04:32:43 PDT 2007


Hi Hans,

Not really a football fan (sacrilege!) but glad your team won.

Hooray! I'm pleased you've got the elusive token now.

Your problems:
>You don't have permission to access 
>/resources/swx/php/lib/phpFlickr/auth.php on this server.
Guess you're on the right track, though difficult for me to tell - maybe 
there's a router blocking access? All my php files are online rather than on 
a dev server so I don't hit this particular bump.

>Warning: main() [function.main]: open_basedir restriction in effect
Reckon that's an open_basedir problem ;-) When I go to the /swx/ page in my 
install it runs through a bunch of PHP checks, one of which is for that. 
Apparently 'Certain SWX APIs will not work properly with this restriction'. 
If you're running this off a dev-server then perhaps you can turn it off. I 
think the subsequent warnings are probably because of that.

>wondering about authGetToken(frob)?
I suppose it depends on what you want to do with all of this. Again, from my 
point of view, for what I'm developing, it's not an issue as I don't need to 
use that method. All I need to do is to update the various files as I 
mentioned in the first email with the key, secret and newly acquired token 
and I can then do what I want (which is basically returning a list of sets 
and going through it to show images - nothing too ambitious).

You may well be fine now. Hope so. Give it a shot.

Oh, a question: what is a 'webhotell'?

Good luck,

Aidann

----- Original Message ----- 
From: "Hans Elgelid" <helgelid at telia.com>
To: "SWX Mailing List" <swx at osflash.org>
Sent: Wednesday, October 31, 2007 4:26 AM
Subject: Re: [swx] flickr api keys, secrets and tokens (Hans Elgelid)


> Don't worry about the digest mode. I'm always online but still slower than 
> you :-)
> (Had to celebrate the angels winning football gold here in Gothenburg)
>
> I got the token now and file upload works fine. Thanks.
>
> It took some time because my first two tries went like this:
>
> After updating my Flikr callback address with my localhost IP address I 
> get the following.
> Forbidden.
> You don't have permission to access 
> /resources/swx/php/lib/phpFlickr/auth.php on this server.
> Turned off windows firwall but no change. Mayby WAMP won't allow outsiders 
> to access Apache by default, or is it Flickr..
>
> When trying my cheap webhotell with coresponding Flikr callback to 
> auth.php I get the following:
>
> Warning: main() [function.main]: open_basedir restriction in effect. 
> File(/usr/local/lib/php/PEAR.php) is not within the allowed path(s): 
> (/home/virtual/mysite.tv:/home/virtual/_tmp) in 
> /home/virtual/mysite.tv/public_html/osflash/resources/swx/php/lib/phpFlickr/PEAR/HTTP/Request.php 
> on line 46
>
> Warning: main(PEAR.php) [function.main]: failed to open stream: Operation 
> not permitted in 
> /home/virtual/mysite.tv/public_html/osflash/resources/swx/php/lib/phpFlickr/PEAR/HTTP/Request.php 
> on line 46
>
> Fatal error: main() [function.require]: Failed opening required 'PEAR.php' 
> (include_path='.:/usr/local/lib/php:/home/virtual/mysite.tv/public_html/osflash/resources/swx/php/lib/phpFlickr/PEAR') 
> in 
> /home/virtual/mysite.tv/public_html/osflash/resources/swx/php/lib/phpFlickr/PEAR/HTTP/Request.php 
> on line 46
>
> Maybe some chmod'ing needed?
>
>
> Finally when doing the same thing on my better webhotell a token is 
> returned and life goes on. :-)
>
>
> Still wondering about authGetToken(frob) ? Do I need it now when I got the 
> token?
>
> /Hans
>
>
> Aidann Bowley wrote:
> Sorry for breaking the thread - had subscribed in digest mode. Changed 
> now.
>
> Aral,
> no problem. I ran round in circles for ages with both the Explorer and 
> then
> when I'd been using phpFlickr instead the setToken method.
>
> Hans,
> Very sorry, one more thing I should have added if you're doing all this 
> with
> phpFlickr (Aral, if you're updating your docs, please add this too). Once
> you've got your api key and secret, before you go to getToken.php, in 
> Flickr
> you should also update the Callback URL field for the relevant key in 
> Flickr
> here. You'll need to click 'edit details', then you'll find it near the
> bottom
> http://www.flickr.com/services/api/keys/
>
> Put the address for your copy of auth.php (not sure if it'll work with 
> your
> localhost address). Then when getToken goes to Flickr it knows where to
> validate against for your secret and key and thus knows you're okay to
> proceed.
>
> Not really sure about the authGetFrob.
>
> Cheerio for now,
>
> Aidann
>
>
>
> =========================
> Thanks for telling about auth.php and getToken.php in the phpFlickr
> library .
> After adding my api key and shared secret and browsing to:
> http://localhost/swx/php/lib/phpFlickr/getToken.php
> I get redirected to the url entered when signing up at Flickr followed
> by a frob, looking something like:
> http://mysite.com/?frob=7215576083917047-896834e23f0049f-14877455&extra=%2Fswx%2Fphp%2Flib%2FphpFlickr%2FgetToken.php
>
> Recognising this and perhaps know the solution?
>
> Since the subject of this thread is spot on I continue the token hunt...
> I'm trying to use the authentication protocol descibed in method
> authGetFrob() in Flickr.php
> authGetFrob()             works fine and returns a frob
> authGetUrl(frob)         works fine and returns an url which when pasted
> into a browser takes me to my Flickr acount where I'm asked to accept
> that my application uses Flickr.
> authGetToken(frob)   shows in SWX Data Analyser:  message=Invalid Frob
> code=108 error=true
>
> I'm using the same frob returned from authGetFrob() which seemed to be
> OK since authGetUrl(frob) is working.
>
> Any ideas?
>
> /Hans
>
>
>
> _______________________________________________
> swx mailing list
> swx at osflash.org
> http://osflash.org/mailman/listinfo/swx_osflash.org
>
>
>


--------------------------------------------------------------------------------


> _______________________________________________
> swx mailing list
> swx at osflash.org
> http://osflash.org/mailman/listinfo/swx_osflash.org
> 





More information about the swx mailing list