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

Unified Diff: chrome/browser/resources/gaia_auth_host/gaia_auth_host.js

Issue 671183002: Revert of Inline sign in extracts gaia id from HTTP header and seeds account tracker (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 2 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
Index: chrome/browser/resources/gaia_auth_host/gaia_auth_host.js
diff --git a/chrome/browser/resources/gaia_auth_host/gaia_auth_host.js b/chrome/browser/resources/gaia_auth_host/gaia_auth_host.js
index cf870cb53baca5ec3de907137a30ce181138a8de..e835e20e79993e9c06e4b320f64fbae1e28cc766 100644
--- a/chrome/browser/resources/gaia_auth_host/gaia_auth_host.js
+++ b/chrome/browser/resources/gaia_auth_host/gaia_auth_host.js
@@ -141,6 +141,18 @@
successCallback_: null,
/**
+ * Invoked when GAIA indicates login success and SAML was used. At this
+ * point, GAIA cookies are present but the identity of the authenticated
+ * user is not known. The embedder of GaiaAuthHost should extract the GAIA
+ * cookies from the cookie jar, query GAIA for the authenticated user's
+ * e-mail address and invoke GaiaAuthHost.setAuthenticatedUserEmail with the
+ * result. The argument is an opaque token that should be passed back to
+ * GaiaAuthHost.setAuthenticatedUserEmail.
+ * @type {function(number)}
+ */
+ retrieveAuthenticatedUserEmailCallback_: null,
+
+ /**
* Invoked when the auth flow needs a user to confirm his/her passwords.
* This could happen when there are more than one passwords scraped during
* SAML flow. The embedder of GaiaAuthHost should show an UI to collect a
@@ -163,21 +175,7 @@
/**
* Invoked when the authentication flow had to be aborted because content
* served over an unencrypted connection was detected.
- */
insecureContentBlockedCallback_: null,
-
- /**
- * Invoked to display an error message to the user when a GAIA error occurs
- * during authentication.
- * @type {function()}
- */
- missingGaiaInfoCallback_: null,
-
- /**
- * Invoked to record that the credentials passing API was used.
- * @type {function()}
- */
- samlApiUsedCallback_: null,
/**
* The iframe container.
@@ -188,6 +186,14 @@
},
/**
+ * Sets retrieveAuthenticatedUserEmailCallback_.
+ * @type {function()}
+ */
+ set retrieveAuthenticatedUserEmailCallback(callback) {
+ this.retrieveAuthenticatedUserEmailCallback_ = callback;
+ },
+
+ /**
* Sets confirmPasswordCallback_.
* @type {function()}
*/
@@ -209,22 +215,6 @@
*/
set insecureContentBlockedCallback(callback) {
this.insecureContentBlockedCallback_ = callback;
- },
-
- /**
- * Sets missingGaiaInfoCallback_.
- * @type {function()}
- */
- set missingGaiaInfoCallback(callback) {
- this.missingGaiaInfoCallback_ = callback;
- },
-
- /**
- * Sets samlApiUsedCallback_.
- * @type {function()}
- */
- set samlApiUsedCallback(callback) {
- this.samlApiUsedCallback_ = callback;
},
/**
@@ -296,6 +286,21 @@
},
/**
+ * Sends the authenticated user's e-mail address to the auth extension.
+ * @param {number} attemptToken The opaque token provided to the
+ * retrieveAuthenticatedUserEmailCallback_.
+ * @param {string} email The authenticated user's e-mail address.
+ */
+ setAuthenticatedUserEmail: function(attemptToken, email) {
+ var msg = {
+ method: 'setAuthenticatedUserEmail',
+ attemptToken: attemptToken,
+ email: email
+ };
+ this.frame_.contentWindow.postMessage(msg, AUTH_URL_BASE);
+ },
+
+ /**
* Invoked to process authentication success.
* @param {Object} credentials Credential object to pass to success
* callback.
@@ -341,12 +346,22 @@
}
this.onAuthSuccess_({email: msg.email,
password: msg.password,
- gaiaId: msg.gaiaId,
useOffline: msg.method == 'offlineLogin',
usingSAML: msg.usingSAML || false,
chooseWhatToSync: msg.chooseWhatToSync,
skipForNow: msg.skipForNow || false,
sessionIndex: msg.sessionIndex || ''});
+ return;
+ }
+
+ if (msg.method == 'retrieveAuthenticatedUserEmail') {
+ if (this.retrieveAuthenticatedUserEmailCallback_) {
+ this.retrieveAuthenticatedUserEmailCallback_(msg.attemptToken,
+ msg.apiUsed);
+ } else {
+ console.error(
+ 'GaiaAuthHost: Invalid retrieveAuthenticatedUserEmailCallback_.');
+ }
return;
}
@@ -387,24 +402,6 @@
return;
}
- if (msg.method == 'missingGaiaInfo') {
- if (this.missingGaiaInfoCallback_) {
- this.missingGaiaInfoCallback_();
- } else {
- console.error('GaiaAuthHost: Invalid missingGaiaInfoCallback_.');
- }
- return;
- }
-
- if (msg.method == 'samlApiUsed') {
- if (this.samlApiUsedCallback_) {
- this.samlApiUsedCallback_();
- } else {
- console.error('GaiaAuthHost: Invalid samlApiUsedCallback_.');
- }
- return;
- }
-
console.error('Unknown message method=' + msg.method);
}
};
« no previous file with comments | « chrome/browser/resources/gaia_auth/success.js ('k') | chrome/browser/ui/webui/chromeos/login/enrollment_screen_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698