{"action":"created","issue":{"url":"https://api.github.com/repos/auth0/passport-linkedin-oauth2/issues/8","labels_url":"https://api.github.com/repos/auth0/passport-linkedin-oauth2/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/auth0/passport-linkedin-oauth2/issues/8/comments","events_url":"https://api.github.com/repos/auth0/passport-linkedin-oauth2/issues/8/events","html_url":"https://github.com/auth0/passport-linkedin-oauth2/issues/8","id":27686960,"number":8,"title":"Changing scope causes an error.","user":{"login":"ggsjyoon","id":4350583,"avatar_url":"https://avatars.githubusercontent.com/u/4350583?v=3","gravatar_id":"","url":"https://api.github.com/users/ggsjyoon","html_url":"https://github.com/ggsjyoon","followers_url":"https://api.github.com/users/ggsjyoon/followers","following_url":"https://api.github.com/users/ggsjyoon/following{/other_user}","gists_url":"https://api.github.com/users/ggsjyoon/gists{/gist_id}","starred_url":"https://api.github.com/users/ggsjyoon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ggsjyoon/subscriptions","organizations_url":"https://api.github.com/users/ggsjyoon/orgs","repos_url":"https://api.github.com/users/ggsjyoon/repos","events_url":"https://api.github.com/users/ggsjyoon/events{/privacy}","received_events_url":"https://api.github.com/users/ggsjyoon/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2014-02-17T01:01:54Z","updated_at":"2015-01-01T23:43:14Z","closed_at":null,"body":"Hello. I'm learning Node.js (Express 3) and trying to make a simple web app using LinkedIn REST API. I've been testing passport-linkedin-oauth2 module lately and found a potential bug. I'm not sure it's from the module or from LinkedIn side.\r\n\r\nThe problem is that changing scope causes an error.\r\n(The project is at https://github.com/ggsjyoon/Job_Search_App)\r\n\r\nInitially I did authentication with everything, and it worked fine.\r\nvar API_SCOPE = [\r\n 'r_basicprofile',\r\n 'r_fullprofile',\r\n 'r_emailaddress',\r\n 'r_network',\r\n 'r_contactinfo',\r\n 'rw_nus',\r\n 'rw_groups',\r\n 'w_messages'];\r\n\r\nThen, I tried authentication again with less scopes, and it stopped working.\r\nvar API_SCOPE = [ 'r_basicprofile',  'r_fullprofile'];\r\nor\r\nvar API_SCOPE = [ 'r_basicprofile']\r\n\r\nThe error message is...\r\nfailed to fetch user profile (status: 401 data: {\r\n  \"errorCode\": 0,\r\n  \"message\": \"Unable to verify access token\",\r\n  \"requestId\": \"FJI5PKEE1H\",\r\n  \"status\": 401,\r\n  \"timestamp\": 1392598443466\r\n})\r\n    at D:\\WebstormProjects\\Job_Search_App\\node_modules\\passport-linkedin-oauth2\\lib\\oauth2.js:29:28\r\n    at passBackControl (D:\\WebstormProjects\\Job_Search_App\\node_modules\\passport-linkedin-oauth2\\node_modules\\passport-oauth\\node_modules\\oauth\\lib\\oauth2.js:109:9)\r\n    at IncomingMessage.<anonymous> (D:\\WebstormProjects\\Job_Search_App\\node_modules\\passport-linkedin-oauth2\\node_modules\\passport-oauth\\node_modules\\oauth\\lib\\oauth2.js:128:7)\r\n    at IncomingMessage.EventEmitter.emit (events.js:117:20)\r\n    at _stream_readable.js:920:16\r\n    at process._tickCallback (node.js:415:13)\r\n\r\nI also tried changing Default Scope section on the Application Detail page of LinkedIn, but it did not work either.\r\n\r\n<br>EDIT 1 :</br> \r\nWhen I'm logged into LinkedIn on my desktop, it works.\r\nFor example, \r\n1) log-in LinkedIn.com on a desktop\r\n2) Run the Express project\r\n3) go to localhost:3000/auth/linkedin\r\n4) The Authorization dialog does not popup\r\n5) Able to retrieve my profile in JSON.\r\n\r\nHowever, if I run the app when I'm logged off from LinkedIn.com, it doesn't work.\r\n1) log-off LinkedIn.com on a desktop\r\n2) Run the Express project\r\n3) go to localhost:3000/auth/linkedin\r\n4) the Authorization dialog pops up and hit the Allow Access button.\r\n5) Above error message appears.\r\n\r\nI have a feeling that I'm doing something wrong. I'm not sure what it is.\r\n\r\nEDIT 2 : \r\nI made a new LinkedIn account to test more.\r\nWhen I use the new LinkedIn account, it works in the two cases from EDIT 1."},"comment":{"url":"https://api.github.com/repos/auth0/passport-linkedin-oauth2/issues/comments/68502542","html_url":"https://github.com/auth0/passport-linkedin-oauth2/issues/8#issuecomment-68502542","issue_url":"https://api.github.com/repos/auth0/passport-linkedin-oauth2/issues/8","id":68502542,"user":{"login":"AlmogBaku","id":98982,"avatar_url":"https://avatars.githubusercontent.com/u/98982?v=3","gravatar_id":"","url":"https://api.github.com/users/AlmogBaku","html_url":"https://github.com/AlmogBaku","followers_url":"https://api.github.com/users/AlmogBaku/followers","following_url":"https://api.github.com/users/AlmogBaku/following{/other_user}","gists_url":"https://api.github.com/users/AlmogBaku/gists{/gist_id}","starred_url":"https://api.github.com/users/AlmogBaku/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlmogBaku/subscriptions","organizations_url":"https://api.github.com/users/AlmogBaku/orgs","repos_url":"https://api.github.com/users/AlmogBaku/repos","events_url":"https://api.github.com/users/AlmogBaku/events{/privacy}","received_events_url":"https://api.github.com/users/AlmogBaku/received_events","type":"User","site_admin":false},"created_at":"2015-01-01T23:43:14Z","updated_at":"2015-01-01T23:43:14Z","body":"+1 this also hapepned to me"}}