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

Unified Diff: remoting/webapp/client_screen.js

Issue 12905012: Webapp changes to support third party authentication (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase, update patch Created 7 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
« no previous file with comments | « remoting/webapp/client_plugin_async.js ('k') | remoting/webapp/client_session.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/client_screen.js
diff --git a/remoting/webapp/client_screen.js b/remoting/webapp/client_screen.js
index 77ff7ecbf07e14ab1ba9ea027e16da85b75b23f0..04a308e42faf3bed35f4613ba1bbc9e84b9d1b85 100644
--- a/remoting/webapp/client_screen.js
+++ b/remoting/webapp/client_screen.js
@@ -251,6 +251,19 @@ remoting.connectMe2MeHostVersionAcknowledged_ = function(host) {
}
remoting.setMode(remoting.AppMode.CLIENT_CONNECTING);
+/**
+ * @param {string} tokenUrl Token-issue URL received from the host.
+ * @param {string} scope OAuth scope to request the token for.
+ * @param {function(string, string):void} onThirdPartyTokenFetched Callback.
+ */
+ var fetchThirdPartyToken = function(
+ tokenUrl, hostPublicKey, scope, onThirdPartyTokenFetched) {
+ var thirdPartyTokenFetcher = new remoting.ThirdPartyTokenFetcher(
+ tokenUrl, hostPublicKey, scope, host.tokenUrlPatterns,
+ onThirdPartyTokenFetched);
+ thirdPartyTokenFetcher.fetchToken();
+ };
+
/** @param {function(string):void} onPinFetched */
var requestPin = function(onPinFetched) {
/** @type {Element} */
@@ -286,7 +299,7 @@ remoting.connectMe2MeHostVersionAcknowledged_ = function(host) {
l10n.localizeElement(message, host.hostName);
remoting.setMode(remoting.AppMode.CLIENT_PIN_PROMPT);
};
- remoting.connector.connectMe2Me(host, requestPin);
+ remoting.connector.connectMe2Me(host, requestPin, fetchThirdPartyToken);
};
/** @param {remoting.ClientSession} clientSession */
« no previous file with comments | « remoting/webapp/client_plugin_async.js ('k') | remoting/webapp/client_session.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698