{"action":"created","issue":{"url":"https://api.github.com/repos/request/request/issues/1482","labels_url":"https://api.github.com/repos/request/request/issues/1482/labels{/name}","comments_url":"https://api.github.com/repos/request/request/issues/1482/comments","events_url":"https://api.github.com/repos/request/request/issues/1482/events","html_url":"https://github.com/request/request/issues/1482","id":61606670,"number":1482,"title":"facebook login problem","user":{"login":"itsmylife","id":820946,"avatar_url":"https://avatars.githubusercontent.com/u/820946?v=3","gravatar_id":"","url":"https://api.github.com/users/itsmylife","html_url":"https://github.com/itsmylife","followers_url":"https://api.github.com/users/itsmylife/followers","following_url":"https://api.github.com/users/itsmylife/following{/other_user}","gists_url":"https://api.github.com/users/itsmylife/gists{/gist_id}","starred_url":"https://api.github.com/users/itsmylife/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/itsmylife/subscriptions","organizations_url":"https://api.github.com/users/itsmylife/orgs","repos_url":"https://api.github.com/users/itsmylife/repos","events_url":"https://api.github.com/users/itsmylife/events{/privacy}","received_events_url":"https://api.github.com/users/itsmylife/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-03-14T13:33:24Z","updated_at":"2015-03-15T02:37:57Z","closed_at":null,"body":"Hi. \r\nI have an issue about facebook login. When I try to login facebook send me this error:\r\n`{ '{\"error\":{\"message\":\"Missing client_id parameter.\",\"type\":\"OAuthException\",\"code\":101}}': '' }`\r\n\r\nI double check my code. There is not error I think. Here is my code. Maybe request has got a bug or something else. Am I missing something?\r\n\r\n```js\r\nvar request = require('request'),\r\n\tqs = require('querystring'),\r\n\tcreateSendToken = require('./jwt.js'),\r\n\tconfig = require('./config.js'),\r\n\tUser = require('../models/User.js');\r\n\r\n\r\nmodule.exports = function(req, res) {\r\n\tvar accessTokenUrl = 'https://graph.facebook.com/oauth/access_token';\r\n\tvar graphApiUrl = ' https://graph.facebook.com/me';\r\n\r\n\tvar params = {\r\n\t\tclient_id: req.body.cliendId,\r\n\t\tredirect_uri: req.body.redirectUri,\r\n\t\tclient_secret: config.FACEBOOK_SECRET,\r\n\t\tcode: req.body.code\r\n\t};\r\n/* I check the req.body. All data is correct. */\r\n\trequest.get({\r\n\t\turl: accessTokenUrl,\r\n\t\tqs: params\r\n\t}, function(err, response, accessToken) {\r\n\t\t/*there is where I got the error */\r\n\t\taccessToken = qs.parse(accessToken);\r\n\r\n\t\trequest.get({\r\n\t\t\turl: graphApiUrl,\r\n\t\t\tqs: accessToken,\r\n\t\t\tjson: true\r\n\t\t}, function(err, response, profile) {\r\n\t\t\tconsole.log(profile.id);\r\n\t\t\tUser.findOne({\r\n\t\t\t\tfacebookId: profile.id\r\n\t\t\t}, function(err, existingUser) {\r\n\t\t\t\tif (existingUser){\r\n\t\t\t\t\treturn createSendToken(existingUser, res);\r\n\t\t\t\t} \r\n\r\n\t\t\t\tvar newUser = new User();\r\n\t\t\t\tnewUser.facebookId = profile.id;\r\n\t\t\t\tnewUser.displayName = profile.name;\r\n\t\t\t\tnewUser.save(function(err){\r\n\t\t\t\t\tcreateSendToken(newUser, res);\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t});\r\n\t});\r\n};\r\n```"},"comment":{"url":"https://api.github.com/repos/request/request/issues/comments/80810520","html_url":"https://github.com/request/request/issues/1482#issuecomment-80810520","issue_url":"https://api.github.com/repos/request/request/issues/1482","id":80810520,"user":{"login":"itsmylife","id":820946,"avatar_url":"https://avatars.githubusercontent.com/u/820946?v=3","gravatar_id":"","url":"https://api.github.com/users/itsmylife","html_url":"https://github.com/itsmylife","followers_url":"https://api.github.com/users/itsmylife/followers","following_url":"https://api.github.com/users/itsmylife/following{/other_user}","gists_url":"https://api.github.com/users/itsmylife/gists{/gist_id}","starred_url":"https://api.github.com/users/itsmylife/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/itsmylife/subscriptions","organizations_url":"https://api.github.com/users/itsmylife/orgs","repos_url":"https://api.github.com/users/itsmylife/repos","events_url":"https://api.github.com/users/itsmylife/events{/privacy}","received_events_url":"https://api.github.com/users/itsmylife/received_events","type":"User","site_admin":false},"created_at":"2015-03-15T02:37:57Z","updated_at":"2015-03-15T02:37:57Z","body":"Yes I use express. I will check grant. I will inform you when I review my code. Thank you simov. "}}