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

Unified Diff: chrome/browser/resources/chromeos/login/screen_gaia_signin.js

Issue 136573002: Retrieve the authenticated user's e-mail from GAIA during SAML login (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments. Created 6 years, 11 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 | « chrome/browser/chromeos/login/saml_browsertest.cc ('k') | chrome/browser/resources/gaia_auth/main.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/chromeos/login/screen_gaia_signin.js
diff --git a/chrome/browser/resources/chromeos/login/screen_gaia_signin.js b/chrome/browser/resources/chromeos/login/screen_gaia_signin.js
index 25e61955bc37130e19e463baf535a5250b1314e6..4f9b0521c25999891a2c165b70a52992ab9a9ef2 100644
--- a/chrome/browser/resources/chromeos/login/screen_gaia_signin.js
+++ b/chrome/browser/resources/chromeos/login/screen_gaia_signin.js
@@ -22,6 +22,7 @@ login.createScreen('GaiaSigninScreen', 'gaia-signin', function() {
EXTERNAL_API: [
'loadAuthExtension',
'updateAuthExtension',
+ 'setAuthenticatedUserEmail',
'doReload',
'onFrameError'
],
@@ -72,6 +73,8 @@ login.createScreen('GaiaSigninScreen', 'gaia-signin', function() {
this.gaiaAuthHost_ = new cr.login.GaiaAuthHost($('signin-frame'));
this.gaiaAuthHost_.addEventListener(
'ready', this.onAuthReady_.bind(this));
+ this.gaiaAuthHost_.retrieveAuthenticatedUserEmailCallback =
+ this.onRetrieveAuthenticatedUserEmail_.bind(this);
this.gaiaAuthHost_.confirmPasswordCallback =
this.onAuthConfirmPassword_.bind(this);
this.gaiaAuthHost_.noPasswordCallback =
@@ -296,6 +299,16 @@ login.createScreen('GaiaSigninScreen', 'gaia-signin', function() {
},
/**
+ * Sends the authenticated user's e-mail address to the auth extension.
+ * @param {number} attemptToken The opaque token provided to
+ * onRetrieveAuthenticatedUserEmail_.
+ * @param {string} email The authenticated user's e-mail address.
+ */
+ setAuthenticatedUserEmail: function(attemptToken, email) {
+ this.gaiaAuthHost_.setAuthenticatedUserEmail(attemptToken, email);
+ },
+
+ /**
* Whether the current auth flow is SAML.
*/
isSAML: function() {
@@ -347,6 +360,17 @@ login.createScreen('GaiaSigninScreen', 'gaia-signin', function() {
},
/**
+ * Invoked when the auth host needs the authenticated user's e-mail to be
+ * retrieved.
+ * @param {number} attemptToken Opaque token to be passed to
+ * setAuthenticatedUserEmail along with the e-mail address.
+ * @private
+ */
+ onRetrieveAuthenticatedUserEmail_: function(attemptToken) {
+ chrome.send('retrieveAuthenticatedUserEmail', [attemptToken]);
+ },
+
+ /**
* Invoked when the auth host needs the user to confirm password.
* @private
*/
« no previous file with comments | « chrome/browser/chromeos/login/saml_browsertest.cc ('k') | chrome/browser/resources/gaia_auth/main.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698