| 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 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 499 * Invoked by the hosting page to verify the Saml password. | 499 * Invoked by the hosting page to verify the Saml password. |
| 500 */ | 500 */ |
| 501 Authenticator.prototype.verifyConfirmedPassword = function(password) { | 501 Authenticator.prototype.verifyConfirmedPassword = function(password) { |
| 502 if (!this.samlHandler_.verifyConfirmedPassword(password)) { | 502 if (!this.samlHandler_.verifyConfirmedPassword(password)) { |
| 503 // Invoke confirm password callback asynchronously because the | 503 // Invoke confirm password callback asynchronously because the |
| 504 // verification was based on messages and caller (GaiaSigninScreen) | 504 // verification was based on messages and caller (GaiaSigninScreen) |
| 505 // does not expect it to be called immediately. | 505 // does not expect it to be called immediately. |
| 506 // TODO(xiyuan): Change to synchronous call when iframe based code | 506 // TODO(xiyuan): Change to synchronous call when iframe based code |
| 507 // is removed. | 507 // is removed. |
| 508 var invokeConfirmPassword = (function() { | 508 var invokeConfirmPassword = (function() { |
| 509 this.confirmPasswordCallback(this.samlHandler_.scrapedPasswordCount); | 509 this.confirmPasswordCallback(this.email_, |
| 510 this.samlHandler_.scrapedPasswordCount); |
| 510 }).bind(this); | 511 }).bind(this); |
| 511 window.setTimeout(invokeConfirmPassword, 0); | 512 window.setTimeout(invokeConfirmPassword, 0); |
| 512 return; | 513 return; |
| 513 } | 514 } |
| 514 | 515 |
| 515 this.password_ = password; | 516 this.password_ = password; |
| 516 this.onAuthCompleted_(); | 517 this.onAuthCompleted_(); |
| 517 }; | 518 }; |
| 518 | 519 |
| 519 /** | 520 /** |
| (...skipping 25 matching lines...) Expand all Loading... |
| 545 if (this.noPasswordCallback) { | 546 if (this.noPasswordCallback) { |
| 546 this.noPasswordCallback(this.email_); | 547 this.noPasswordCallback(this.email_); |
| 547 } else { | 548 } else { |
| 548 console.error('Authenticator: No password scraped for SAML.'); | 549 console.error('Authenticator: No password scraped for SAML.'); |
| 549 } | 550 } |
| 550 return; | 551 return; |
| 551 } else if (this.needPassword) { | 552 } else if (this.needPassword) { |
| 552 if (this.confirmPasswordCallback) { | 553 if (this.confirmPasswordCallback) { |
| 553 // Confirm scraped password. The flow follows in | 554 // Confirm scraped password. The flow follows in |
| 554 // verifyConfirmedPassword. | 555 // verifyConfirmedPassword. |
| 555 this.confirmPasswordCallback(this.samlHandler_.scrapedPasswordCount); | 556 this.confirmPasswordCallback(this.email_, |
| 557 this.samlHandler_.scrapedPasswordCount); |
| 556 return; | 558 return; |
| 557 } | 559 } |
| 558 } | 560 } |
| 559 | 561 |
| 560 this.onAuthCompleted_(); | 562 this.onAuthCompleted_(); |
| 561 }; | 563 }; |
| 562 | 564 |
| 563 /** | 565 /** |
| 564 * Invoked to process authentication completion. | 566 * Invoked to process authentication completion. |
| 565 * @private | 567 * @private |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 760 Authenticator.AuthMode = AuthMode; | 762 Authenticator.AuthMode = AuthMode; |
| 761 Authenticator.SUPPORTED_PARAMS = SUPPORTED_PARAMS; | 763 Authenticator.SUPPORTED_PARAMS = SUPPORTED_PARAMS; |
| 762 | 764 |
| 763 return { | 765 return { |
| 764 // TODO(guohui, xiyuan): Rename GaiaAuthHost to Authenticator once the old | 766 // TODO(guohui, xiyuan): Rename GaiaAuthHost to Authenticator once the old |
| 765 // iframe-based flow is deprecated. | 767 // iframe-based flow is deprecated. |
| 766 GaiaAuthHost: Authenticator, | 768 GaiaAuthHost: Authenticator, |
| 767 Authenticator: Authenticator | 769 Authenticator: Authenticator |
| 768 }; | 770 }; |
| 769 }); | 771 }); |
| OLD | NEW |