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

Side by Side Diff: chrome/browser/resources/gaia_auth_host/saml_handler.js

Issue 2380203002: cros: Fix API 'add' password and complete auth racing (Closed)
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/resources/gaia_auth_host/authenticator.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 <include src="post_message_channel.js"> 5 <include src="post_message_channel.js">
6 6
7 /** 7 /**
8 * @fileoverview Saml support for webview based auth. 8 * @fileoverview Saml support for webview based auth.
9 */ 9 */
10 10
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 424
425 if (call.method == 'add') { 425 if (call.method == 'add') {
426 if (API_KEY_TYPES.indexOf(call.keyType) == -1) { 426 if (API_KEY_TYPES.indexOf(call.keyType) == -1) {
427 console.error('SamlHandler.onAPICall_: unsupported key type'); 427 console.error('SamlHandler.onAPICall_: unsupported key type');
428 return; 428 return;
429 } 429 }
430 // Not setting |email_| and |gaiaId_| because this API call will 430 // Not setting |email_| and |gaiaId_| because this API call will
431 // eventually be followed by onCompleteLogin_() which does set it. 431 // eventually be followed by onCompleteLogin_() which does set it.
432 this.apiToken_ = call.token; 432 this.apiToken_ = call.token;
433 this.apiPasswordBytes_ = call.passwordBytes; 433 this.apiPasswordBytes_ = call.passwordBytes;
434
435 this.dispatchEvent(new CustomEvent('apiPasswordAdded'));
434 } else if (call.method == 'confirm') { 436 } else if (call.method == 'confirm') {
435 if (call.token != this.apiToken_) 437 if (call.token != this.apiToken_)
436 console.error('SamlHandler.onAPICall_: token mismatch'); 438 console.error('SamlHandler.onAPICall_: token mismatch');
437 } else { 439 } else {
438 console.error('SamlHandler.onAPICall_: unknown message'); 440 console.error('SamlHandler.onAPICall_: unknown message');
439 } 441 }
440 }, 442 },
441 443
442 onUpdatePassword_: function(channel, msg) { 444 onUpdatePassword_: function(channel, msg) {
443 if (this.isSamlPage_) 445 if (this.isSamlPage_)
(...skipping 20 matching lines...) Expand all
464 466
465 onGetSAMLFlag_: function(channel, msg) { 467 onGetSAMLFlag_: function(channel, msg) {
466 return this.isSamlPage_; 468 return this.isSamlPage_;
467 }, 469 },
468 }; 470 };
469 471
470 return { 472 return {
471 SamlHandler: SamlHandler 473 SamlHandler: SamlHandler
472 }; 474 };
473 }); 475 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/gaia_auth_host/authenticator.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698