sybrenstuvel/flickrapi

Authentication via browser not being triggered

atif93 opened this issue · 5 comments

I have a simple python program for downloading files from Flickr accounts.
The public downloads happen perfectly but for private files I'm using
flickr.authenticate_via_browser(perms='read')
which is not triggering the browser to open. The execution of the python program doesn't stop but no private files are downloaded.

Please include a minimal example that shows the problem.

Okay I found out the problem.
When any Flickr user account has authorized the app, the browser authentication is not triggering (reason I think is that the token is saved in cache).
So, is there a way to have the browser authentication trigger the opening of browser by bypassing the cache check (because the token is different for different accounts)?

The default behaviour is to expect that the user of you application is the same as the user who is currently logged in on the system. If you want to support multiple Flickr users who all use your application while logged in on the same machine on the same user account, you need to take some extra steps. I would suggest reading the section Authentication and Authorization of the documentation.

passing username parameter to the FlickrAPI constructor did the trick.
Now tokens for different users are not mixed up in the cache.

Thanks for posting an update, I'm glad it worked out for you.