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

Unified Diff: chrome/browser/resources/chromeos/login/oobe_screen_oauth_enrollment.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/chromeos/login/oobe_screen_oauth_enrollment.js
diff --git a/chrome/browser/resources/chromeos/login/oobe_screen_oauth_enrollment.js b/chrome/browser/resources/chromeos/login/oobe_screen_oauth_enrollment.js
index 67e163d28b7dbc0b2e052e83dfb1fc310d130c6a..09475949c27c75d1ebe2b82a260b1a1717d8533f 100644
--- a/chrome/browser/resources/chromeos/login/oobe_screen_oauth_enrollment.js
+++ b/chrome/browser/resources/chromeos/login/oobe_screen_oauth_enrollment.js
@@ -16,6 +16,7 @@
'showStep',
'showError',
'showWorking',
+ 'setAuthenticatedUserEmail',
'doReload',
],
@@ -205,6 +206,24 @@
this.showStep(STEP_WORKING);
},
+ /**
+ * Invoked when the authenticated user's e-mail address has been retrieved.
+ * This completes SAML authentication.
+ * @param {number} attemptToken An opaque token used to correlate this
+ * method invocation with the corresponding request to retrieve the
+ * user's e-mail address.
+ * @param {string} email The authenticated user's e-mail address.
+ */
+ setAuthenticatedUserEmail: function(attemptToken, email) {
+ if (this.attemptToken_ != attemptToken)
+ return;
+
+ if (!email)
+ this.showError(loadTimeData.getString('fatalEnrollmentError'), false);
+ else
+ chrome.send('oauthEnrollCompleteLogin', [email]);
+ },
+
doReload: function() {
$('oauth-enroll-signin-frame').contentWindow.location.href =
this.signInUrl_;
@@ -270,8 +289,18 @@
var msg = m.data;
if (msg.method == 'completeLogin') {
- // A user has successfully authenticated via regular GAIA or SAML.
+ // A user has successfully authenticated via regular GAIA.
chrome.send('oauthEnrollCompleteLogin', [msg.email]);
+ }
+
+ if (msg.method == 'retrieveAuthenticatedUserEmail') {
+ // A user has successfully authenticated via SAML. However, the user's
+ // identity is not known. Instead of reporting success immediately,
+ // retrieve the user's e-mail address first.
+ this.attemptToken_ = msg.attemptToken;
+ this.showWorking(null);
+ chrome.send('oauthEnrollRetrieveAuthenticatedUserEmail',
+ [msg.attemptToken]);
}
if (msg.method == 'authPageLoaded' && this.currentStep_ == STEP_SIGNIN) {
@@ -289,12 +318,6 @@
loadTimeData.getStringF('insecureURLEnrollmentError', msg.url),
false);
}
-
- if (msg.method == 'missingGaiaInfo') {
- this.showError(
- loadTimeData.getString('fatalEnrollmentError'),
- false);
- }
}
};
});
« no previous file with comments | « chrome/browser/resources/chromeos/login/login_common.js ('k') | chrome/browser/resources/chromeos/login/screen_gaia_signin.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698