mendeley_auth: Function to obtain OAuth tokens from Mendeley to faciliate...

Description Usage Arguments Value Author(s) Examples

View source: R/user_mendeley_auth.r

Description

User specific API methods require obtaining access keys from Mendeley.com. To do so, first sign up at the Mendeley developer site and obtain Mendeley API keys. Ideally you should store these keys in your .rprofile like so: options(MendeleyKey="Your_Key") options(MendeleySecret="Your_secret_key") If this is not possible (assuming you are on a public machine), then you can spefify both inline. Calling mendeley_auth() with the right keys will launch your default browser and take you to Mendeley.com to authorize this application. If you are not logged in, you will first be prompted to login with your Mendeley user/pass. Next, click accept to see a pin. At that point, copy the pin and paste it back at the R prompt. If you assign this to a R object, then you can use that as the first argument in all functions that require authentication. If you have successfully completed this step, you should ideally save the Oauth credential object to disk for future use. There is no need to repeat this step each time.

Usage

1
2
3
4
mendeley_auth(cKey = getOption("MendeleyKey",
  stop("Missing Mendeley consumer key")),
  cSecret = getOption("MendeleyPrivateKey",
  stop("Missing Mendeley app secret")), curl = getCurlHandle(), ...)

Arguments

cKey

Consumer key. can be supplied here or read from Options()

cSecret

Consumer secret. can be supplied here or read from Options()

curl

If using in a loop, call getCurlHandle() first and pass the returned value in here (avoids unnecessary footprint)

...

optional additional curl options (debugging tools mostly).

Value

OAUth credential.

Author(s)

Karthik Ram [email protected]

Examples

1
2
3
4
5
6
## Not run: 
mc <- mendeley_auth('YOUR_CONSUMER_KEY', 'YOUR_CONSUMER_SECRET')
mc <- mendeley_auth() # If your keys are stored in options using
as MendeleyKey and MendeleyPrivateKey.

## End(Not run)

ropensci/RMendeley documentation built on May 16, 2018, 6:57 a.m.