authentication

Topics: User Forum
Jan 7, 2007 at 10:17 PM
Hi
I'm looking for a way to display sets of flickr images on a web page and came across your wrapper.
I downloaded and messed about with the desktop example code for a while. I have an API key and secret question and was able to authenticate and get a token no trouble.

However, I want to run the desktop or web application without having to authenticate by launching the web browser each time I run the code. Am I being really daft or what? Do I really have to authenticate manually every time I run the app?

How do I run some code to authenticate like the flickr uploader without going to the url each
time?

thanks
Angus
Coordinator
Jan 8, 2007 at 1:51 PM
You don't need to authenticate every time - once you have the authentication token you just store it somewhere and use it next time. Dending on how your application works will determine the best place to do this.
Jan 8, 2007 at 3:28 PM

I was wondering if it is possible to authenticate with Flickr using the HttpWebRequest object.

For example, by doing something like:

Flickr flickr = new Flickr(sApiKey, sSharedSecret);
string sUrl = flickr.AuthCalcWebUrl(AuthLevel.Write);

HttpWebRequest oRequest = (HttpWebRequest)HttpRequest.Create(sUrl);

HttpWebResponse oResponse = (HttpWebResponse)oRequest.GetResponse();

....

Thanks!
Maciek
Jan 8, 2007 at 4:08 PM
thanks Sam

So, once authenticated what do I need to access Flickr? The API, secret key and the token or just the token?

If you can point me to some more code samples I'd be grateful.

A.
Coordinator
Jan 8, 2007 at 4:25 PM
MrMagic: No, and it shouldn't be either - the whole point of authenticating is that it requires USER INTERVENTION - trying to automate this would break the terms of service of Flickr at the very least, and we should have to call you a spammer as well...

Angus: To call methods that don't require authentication (e.g. public searches) you only need the API Key. To perform methods that require authentication require all three (e.g. getting details of private photos).

What are you after in terms of code samples? Have you ran the desktop application properly? If you simply type the authentication token into the text box instead of doing the authenticate bit... (this could be done on the Upload or the Update forms for example).
Jan 8, 2007 at 4:41 PM
Hi Sam,

Thank you for your prompt reply.

Just to clarify, what I would like to do is have the user supply the api token and shared secret, but have my application make the call to authenticate against Flickr.

What I wanted to do is encapsulate the authenication mechanism so that my application can retrieve the frob on behalf of the user without a Response.Redirect.

Also, please note that my intention is not at all to spam anyone, but to log into my own account.

Thanks!
Maciek
Jan 8, 2007 at 5:43 PM
thanks Sam

yes. I've ran the desktop application and it works fine. I just didn't really understand the Flickr API and found the docs confusing.

I'll have a go again with the token as you suggest and see how I get on.

thanks
A.
Coordinator
Jan 9, 2007 at 11:31 AM
Hi Maciek

I'm confused as to why the user needs to supply the API Key and Secret. If this is a web application then you just need to put your api key, secret, and your authentication token into your code and the 'user' using your web site will be calling Flickr as if they where you (i.e. any photos you upload would be uploaded to your account and searches will show your private photos).

This is the exact scenario that the sample web application on the Example page shows.

Sam