authenticate: Log-in to Flickr to create a session

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

This function logs into Flickr using the given api_key which has been established for the application and the secret which is created when the application is registered. This contacts Flickr and gets a "frob" and then uses that to get the user to grant read permission on the Flickr account. It does this by display a page in a Web browser and waiting for the user to click on the green button "Ok, I'll allow it". Then it contacts Flickr again to get a token for the session. This should be saved and passed in every call to a Flickr API operation. Alternatively, it can be stored in a FlickrSession object created by calling flickrSession. This hides the need to pass the values of the secret, api_key and token in every operation call.

Usage

1
2
3
authenticate(api_key, secret,
             frob = flickr.auth.getFrob(secret, character(), api_key),
             wait = 10, permission = "read", ...)

Arguments

api_key

a string. See the documentation in Rflickr.xml in the doc/ directory for how to register an application and create an api_key and secret.

secret

a string that comes with the creation of an application.

frob

a string. Typically one would never specify this. It is a parameter to allow those who want to get the frob themselves provide it to the call to flickr.auth.getToken.

wait

the number of seconds to wait in order to give the user an opportunity to authorize the frob via their web browser.

permission

one of "read", "write" or "delete" that grant successively more privileges.

...

additional parameters that are passed on to getForm, i.e. other parameters for the form or .opts to specify CURL options.

Details

This calls flickr.auth.getFrob and flickr.auth.getToken to intiate the session with Flickr.

Value

a character string which is to be used as the value of the auth_token parameter in all calls to Flickr operations via the flickr.* functions in this package.

Author(s)

Duncan Temple Lang

References

http://www.flickr.com/services/api

See Also

flickrSession All of the flickr.* functions.

Examples

1
2
3
4
5
## Not run: 
  tok = authenticate("myHexadecimalAppId243423abc4238948", "a4c5f6...")
  flickr.tags.getHotList(secret, tok, api_key)

## End(Not run)

duncantl/Rflickr documentation built on May 15, 2019, 5:54 p.m.