Index: chrome/browser/resources/gaia_auth/main.js |
diff --git a/chrome/browser/resources/gaia_auth/main.js b/chrome/browser/resources/gaia_auth/main.js |
index ba48c65dc9049f2dc8cb453d754480286497b3f8..6a34482422b7108ca069dfd40c44b08ba82a21ed 100644 |
--- a/chrome/browser/resources/gaia_auth/main.js |
+++ b/chrome/browser/resources/gaia_auth/main.js |
@@ -48,6 +48,7 @@ Authenticator.getInstance = function() { |
Authenticator.prototype = { |
email_: null, |
+ gaiaId_: null, |
// Depending on the key type chosen, this will contain the plain text password |
// or a credential derived from it along with the information required to |
@@ -221,8 +222,9 @@ Authenticator.prototype = { |
'usingSAML': this.isSAMLFlow_, |
'chooseWhatToSync': this.chooseWhatToSync_ || false, |
'skipForNow': opt_extraMsg && opt_extraMsg.skipForNow, |
- 'sessionIndex': opt_extraMsg && opt_extraMsg.sessionIndex |
- }; |
+ 'sessionIndex': opt_extraMsg && opt_extraMsg.sessionIndex, |
+ 'gaiaId': (opt_extraMsg && opt_extraMsg.gaiaId) || this.gaiaId_ |
+ }; |
window.parent.postMessage(msg, this.parentPage_); |
this.supportChannel_.send({name: 'resetAuth'}); |
}, |
@@ -268,6 +270,7 @@ Authenticator.prototype = { |
// from the GAIA login form are no longer relevant and can be discarded. |
this.isSAMLFlow_ = true; |
this.email_ = null; |
+ this.gaiaId_ = null; |
this.passwordBytes_ = null; |
} |
@@ -318,6 +321,7 @@ Authenticator.prototype = { |
} |
this.apiToken_ = call.token; |
this.email_ = call.user; |
+ this.gaiaId_ = null; // TODO(rogerta): no idea what to do here. |
this.passwordBytes_ = call.passwordBytes; |
} else if (call.method == 'confirm') { |
if (call.token != this.apiToken_) |
@@ -377,8 +381,10 @@ Authenticator.prototype = { |
maybeCompleteSAMLLogin_: function() { |
// SAML login is complete when the user's e-mail address has been retrieved |
// from GAIA and the user has successfully confirmed the password. |
- if (this.email_ !== null && this.passwordBytes_ !== null) |
+ if (this.email_ !== null && this.gaiaId_ !== null && |
+ this.passwordBytes_ !== null) { |
this.completeLogin_(); |
+ } |
}, |
onVerifyConfirmedPassword_: function(password) { |
@@ -402,6 +408,7 @@ Authenticator.prototype = { |
var msg = e.data; |
if (msg.method == 'attemptLogin' && this.isGaiaMessage_(e)) { |
this.email_ = msg.email; |
+ this.gaiaId_ = msg.gaiaId; |
xiyuan
2014/09/22 21:48:56
This does not work for cros login. 'attemptLogin'
Roger Tawa OOO till Jul 10th
2014/09/23 19:43:42
Done.
|
this.passwordBytes_ = msg.password; |
this.attemptToken_ = msg.attemptToken; |
this.chooseWhatToSync_ = msg.chooseWhatToSync; |
@@ -416,6 +423,7 @@ Authenticator.prototype = { |
this.maybeInitialized_(); |
} |
this.email_ = null; |
+ this.gaiaId_ = null; |
this.passwordBytes_ = null; |
this.attemptToken_ = null; |
this.isSAMLFlow_ = false; |
@@ -425,6 +433,7 @@ Authenticator.prototype = { |
this.isParentMessage_(e)) { |
if (this.attemptToken_ == msg.attemptToken) { |
this.email_ = msg.email; |
+ this.gaiaId_ = msg.gaiaId; |
xiyuan
2014/09/22 21:48:56
This probably does not work either. 'setAuthentica
Roger Tawa OOO till Jul 10th
2014/09/23 19:43:43
Done.
|
this.maybeCompleteSAMLLogin_(); |
} |
} else if (msg.method == 'confirmLogin' && this.isInternalMessage_(e)) { |