To get the chromoting host list, pass the OAuth access token as a URL parameter,

not in the headers.

BUG=116574

Review URL: https://chromiumcodereview.appspot.com/9584020

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@124730 0039d316-1c4b-4281-b951-d872f2087c98
parent 944822b4
...@@ -91,10 +91,12 @@ remoting.HostList.prototype.refresh = function(onDone) { ...@@ -91,10 +91,12 @@ remoting.HostList.prototype.refresh = function(onDone) {
} }
/** @param {string} token The OAuth2 token. */ /** @param {string} token The OAuth2 token. */
var getHosts = function(token) { var getHosts = function(token) {
var headers = { 'Authorization': 'OAuth ' + token }; // TODO(simonmorris): Pass the access token in a header, not a URL
// parameter, when crbug.com/116574 has a better fix.
var params = { 'access_token': token };
remoting.xhr.get( remoting.xhr.get(
'https://www.googleapis.com/chromoting/v1/@me/hosts', 'https://www.googleapis.com/chromoting/v1/@me/hosts',
parseHostListResponse, '', headers); parseHostListResponse, params);
}; };
remoting.oauth2.callWithToken(getHosts); remoting.oauth2.callWithToken(getHosts);
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment