{"action":"closed","issue":{"url":"https://api.github.com/repos/OfficeDev/PnP/issues/1171","labels_url":"https://api.github.com/repos/OfficeDev/PnP/issues/1171/labels{/name}","comments_url":"https://api.github.com/repos/OfficeDev/PnP/issues/1171/comments","events_url":"https://api.github.com/repos/OfficeDev/PnP/issues/1171/events","html_url":"https://github.com/OfficeDev/PnP/issues/1171","id":106837578,"number":1171,"title":"Getting Access token from context token flow, nodejs application Provider Hosted APP","user":{"login":"mauricionr","id":2263551,"avatar_url":"https://avatars.githubusercontent.com/u/2263551?v=3","gravatar_id":"","url":"https://api.github.com/users/mauricionr","html_url":"https://github.com/mauricionr","followers_url":"https://api.github.com/users/mauricionr/followers","following_url":"https://api.github.com/users/mauricionr/following{/other_user}","gists_url":"https://api.github.com/users/mauricionr/gists{/gist_id}","starred_url":"https://api.github.com/users/mauricionr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mauricionr/subscriptions","organizations_url":"https://api.github.com/users/mauricionr/orgs","repos_url":"https://api.github.com/users/mauricionr/repos","events_url":"https://api.github.com/users/mauricionr/events{/privacy}","received_events_url":"https://api.github.com/users/mauricionr/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-09-16T18:50:14Z","updated_at":"2015-09-17T10:14:48Z","closed_at":"2015-09-17T10:14:48Z","body":"I had followed a few examples in how to get access_token for sharepoint provider hosted apps\r\n\r\nhttps://code.msdn.microsoft.com/office/SharePoint-2013-Perform-8a78b8ef/sourcecode?fileId=117521&pathId=1932320454\r\n\r\n\r\nand i got this error\r\n\r\n```\r\n\"{\\\"error\\\":\\\"invalid_request\\\",\\\"error_description\\\":\\\"ACS90004: The request contains 1 tokens separated by \\\\u0027=\\\\u0027 instead of a single key v\r\nalue pair.\\\\r\\\\nTrace ID: cc9b45ba-2f55-4a92-a325-b95d68356241\\\\r\\\\nCorrelation ID: a8f6bd67-0bf1-416a-8507-80cb761df95b\\\\r\\\\nTimestamp: 2015-09-16 18\r\n:00:16Z\\\",\\\"error_codes\\\":[90004],\\\"timestamp\\\":\\\"2015-09-16 18:00:16Z\\\",\\\"trace_id\\\":\\\"cc9b45ba-2f55-4a92-a325-b95d68356241\\\",\\\"correlation_id\\\":\\\"a8\r\nf6bd67-0bf1-416a-8507-80cb761df95b\\\"}\"\r\n```\r\n\r\n\r\nHere is my code.\r\n\r\n```\r\nreq.session.sp_info = req.query;\r\nreq.session.sp_oauth = req.body;\r\nvar client_ID = \"{{clientID}}\"\r\nvar appSecret = '{{clientSECRET}}';\r\nvar decoded = jwt.decode(req.session.sp_oauth.SPAppToken, appSecret)\r\nvar appctx = JSON.parse(decoded.appctx);\r\nvar realm = decoded.aud.split('@')[1];\r\n//var acs = \"https://accounts.accesscontrol.windows.net/\" + realm + \"/tokens/OAuth/2\"\r\nvar options = {\r\n      url: appctx.SecurityTokenServiceUri,\r\n      data: {\r\n                'grant_type': 'refresh_token',\r\n                'client_id': client_ID,\r\n                'client_secret': appSecret,\r\n                'refresh_token': decoded.refreshtoken,\r\n                'resource': decoded.aud\r\n            }\r\n        };\r\nvar callback = function (req, res, body) {\r\n      console.log(JSON.stringify(body));\r\n}\r\nvar r = request.post(options, callback)\r\n```\r\n\r\nThere's any other place that i can ask?\r\n\r\nThanks in advance!"}}