OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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="saml_handler.js"> | 5 <include src="saml_handler.js"> |
6 | 6 |
7 /** | 7 /** |
8 * @fileoverview An UI component to authenciate to Chrome. The component hosts | 8 * @fileoverview An UI component to authenciate to Chrome. The component hosts |
9 * IdP web pages in a webview. A client who is interested in monitoring | 9 * IdP web pages in a webview. A client who is interested in monitoring |
10 * authentication events should pass a listener object of type | 10 * authentication events should pass a listener object of type |
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 * Invoked by the hosting page to verify the Saml password. | 486 * Invoked by the hosting page to verify the Saml password. |
487 */ | 487 */ |
488 Authenticator.prototype.verifyConfirmedPassword = function(password) { | 488 Authenticator.prototype.verifyConfirmedPassword = function(password) { |
489 if (!this.samlHandler_.verifyConfirmedPassword(password)) { | 489 if (!this.samlHandler_.verifyConfirmedPassword(password)) { |
490 // Invoke confirm password callback asynchronously because the | 490 // Invoke confirm password callback asynchronously because the |
491 // verification was based on messages and caller (GaiaSigninScreen) | 491 // verification was based on messages and caller (GaiaSigninScreen) |
492 // does not expect it to be called immediately. | 492 // does not expect it to be called immediately. |
493 // TODO(xiyuan): Change to synchronous call when iframe based code | 493 // TODO(xiyuan): Change to synchronous call when iframe based code |
494 // is removed. | 494 // is removed. |
495 var invokeConfirmPassword = (function() { | 495 var invokeConfirmPassword = (function() { |
496 this.confirmPasswordCallback(this.samlHandler_.scrapedPasswordCount); | 496 this.confirmPasswordCallback(this.email_, |
| 497 this.samlHandler_.scrapedPasswordCount); |
497 }).bind(this); | 498 }).bind(this); |
498 window.setTimeout(invokeConfirmPassword, 0); | 499 window.setTimeout(invokeConfirmPassword, 0); |
499 return; | 500 return; |
500 } | 501 } |
501 | 502 |
502 this.password_ = password; | 503 this.password_ = password; |
503 this.onAuthCompleted_(); | 504 this.onAuthCompleted_(); |
504 }; | 505 }; |
505 | 506 |
506 /** | 507 /** |
(...skipping 25 matching lines...) Expand all Loading... |
532 if (this.noPasswordCallback) { | 533 if (this.noPasswordCallback) { |
533 this.noPasswordCallback(this.email_); | 534 this.noPasswordCallback(this.email_); |
534 } else { | 535 } else { |
535 console.error('Authenticator: No password scraped for SAML.'); | 536 console.error('Authenticator: No password scraped for SAML.'); |
536 } | 537 } |
537 return; | 538 return; |
538 } else if (this.needPassword) { | 539 } else if (this.needPassword) { |
539 if (this.confirmPasswordCallback) { | 540 if (this.confirmPasswordCallback) { |
540 // Confirm scraped password. The flow follows in | 541 // Confirm scraped password. The flow follows in |
541 // verifyConfirmedPassword. | 542 // verifyConfirmedPassword. |
542 this.confirmPasswordCallback(this.samlHandler_.scrapedPasswordCount); | 543 this.confirmPasswordCallback(this.email_, |
| 544 this.samlHandler_.scrapedPasswordCount); |
543 return; | 545 return; |
544 } | 546 } |
545 } | 547 } |
546 | 548 |
547 this.onAuthCompleted_(); | 549 this.onAuthCompleted_(); |
548 }; | 550 }; |
549 | 551 |
550 /** | 552 /** |
551 * Invoked to process authentication completion. | 553 * Invoked to process authentication completion. |
552 * @private | 554 * @private |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
747 Authenticator.AuthMode = AuthMode; | 749 Authenticator.AuthMode = AuthMode; |
748 Authenticator.SUPPORTED_PARAMS = SUPPORTED_PARAMS; | 750 Authenticator.SUPPORTED_PARAMS = SUPPORTED_PARAMS; |
749 | 751 |
750 return { | 752 return { |
751 // TODO(guohui, xiyuan): Rename GaiaAuthHost to Authenticator once the old | 753 // TODO(guohui, xiyuan): Rename GaiaAuthHost to Authenticator once the old |
752 // iframe-based flow is deprecated. | 754 // iframe-based flow is deprecated. |
753 GaiaAuthHost: Authenticator, | 755 GaiaAuthHost: Authenticator, |
754 Authenticator: Authenticator | 756 Authenticator: Authenticator |
755 }; | 757 }; |
756 }); | 758 }); |
OLD | NEW |