Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1159)

Unified Diff: remoting/webapp/crd/js/host_daemon_facade.js

Issue 1076093003: Added method to host daemon to exchange an auth code for just an OAuth (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« remoting/host/setup/oauth_client.h ('K') | « remoting/host/setup/oauth_client.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/crd/js/host_daemon_facade.js
diff --git a/remoting/webapp/crd/js/host_daemon_facade.js b/remoting/webapp/crd/js/host_daemon_facade.js
index 0596b5745cd4b62de6bef40758cc67c2eae90cc6..6569e807930b08d4bd767beb3ddd810c60fed99e 100644
--- a/remoting/webapp/crd/js/host_daemon_facade.js
+++ b/remoting/webapp/crd/js/host_daemon_facade.js
@@ -294,6 +294,14 @@ remoting.HostDaemonFacade.prototype.handleIncomingMessage_ =
throw 'Missing userEmail or refreshToken';
}
+ case 'getTokenFromAuthCodeResponse':
+ var refreshToken = base.getStringAttr(message, 'refreshToken');
+ if (refreshToken) {
+ return refreshToken;
+ } else {
+ throw 'Missing refreshToken';
+ }
+
default:
throw 'Unexpected native message: ' + message;
}
@@ -495,7 +503,6 @@ remoting.HostDaemonFacade.prototype.getHostClientId = function() {
};
/**
- *
* @param {string} authorizationCode OAuth authorization code.
* @return {!Promise<{remoting.XmppCredentials}>}
*/
@@ -506,3 +513,15 @@ remoting.HostDaemonFacade.prototype.getCredentialsFromAuthCode =
authorizationCode: authorizationCode
});
};
+
+/**
+ * @param {string} authorizationCode OAuth authorization code.
+ * @return {!Promise<string>}
+ */
+remoting.HostDaemonFacade.prototype.getTokenFromAuthCode =
+ function(authorizationCode) {
+ return this.postMessage_({
+ type: 'getTokenFromAuthCode',
+ authorizationCode: authorizationCode
+ });
+};
« remoting/host/setup/oauth_client.h ('K') | « remoting/host/setup/oauth_client.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698