title: using httr to connect to API with pem certificate
body: <p>I've successfully connected to a public app I created using this syntax:</p>
  
  <pre><code>library(httr)
  public_app &lt;- oauth_app("website_public",
                 key    = "BLAHBLAHBLAHBLAH",
                 secret = "ADIFFERENTBLAHBLAH")
  website_token_public &lt;- oauth1.0_token(oauth_endpoint(authorize = 'https://api.website.com/oauth/Authorize',request = 'https://api.website.com/oauth/RequestToken',access = 'https://api.website.com/oauth/AccessToken'),public_app)
  req=GET("https://api.website.com/api/stuff/uniquestring",config(token=website_token_public))
  </code></pre>
  
  <p>but, being a public app, it expires so I'm attempting to use a private app based on a X509 certificate.
  I've successfully created the *.cer certificate and uploaded it the to website app.
  I'm now trying, and failing, to connect to it via R.
  My (albeit limited) understand is that a private key doesn't require the token, which to me renders the oauth1.0_token bit redundant.  But if that is the case, how/where do I specify my key and secret.
  So far I've got:</p>
  
  <pre><code>private_app &lt;- oauth_app("website_private",key = "SOMEMOREBLAH",secret = "FURTHERBLAH")
  req &lt;- GET("https://api.website.com/api/stuff/uniquestring", config(cainfo='/filepath/websitekey.pem'))
  </code></pre>
  
  <p>but I can't figure out whether I need to put the key &amp; secret into the GET-config() -and if so, where?  Or do I still need to specify a oauth1.0_token?  I have tried various iterations along the lines of:</p>
  
  <pre><code>website_token_private &lt;- oauth1.0_token(oauth_endpoint(request = NULL,authorize = NULL, access = 'https://api.website.com/oauth/AccessToken'), app=private_app)
  </code></pre>
  
  <p>all advice extremely appreciated!</p>
  
  <p>thanks.</p>