title: How to use the oauth2.0_token function from httr package with facebook API?
body: <p>I have a collection of facebook functions that relies on the httr package. </p>
  
  <p>The usual procedure is that one has to set oauth app specs and facebook endpoints. Until recently this worked like a charm but now when I try to get the token by the oauth2.0_token function I get the error:</p>
  
  <blockquote>
    <p>Waiting for authentication in browser... Press Esc/Ctrl + C to abort
    Authentication complete. Fejl i init_oauth2.0(self$endpoint, self$app,
    scope = self$params$scope,  :    Bad Request (HTTP 400).</p>
  </blockquote>
  
  <p>You see my code below:</p>
  
  <pre><code>facebook_app &lt;- oauth_app("facebook", key = "XXXX", secret = "YYYY")
    # end point
    facebook_ep &lt;- oauth_endpoint(
      authorize = "https://www.facebook.com/dialog/oauth",
      access = "https://graph.facebook.com/oauth/access_token")
    # token from endpoint and oauth
    fb.token &lt;- oauth2.0_token(facebook_ep, facebook_app, user_params = facebook_ep)
  </code></pre>
  
  <p>I have been to various posts and forums but I have not had luck in finding a solution yet.</p>