Chromium Code Reviews| 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 632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 643 if (this.noPasswordCallback) { | 643 if (this.noPasswordCallback) { |
| 644 this.noPasswordCallback(this.email_); | 644 this.noPasswordCallback(this.email_); |
| 645 return; | 645 return; |
| 646 } | 646 } |
| 647 | 647 |
| 648 // Fall through to finish the auth flow even if this.needPassword | 648 // Fall through to finish the auth flow even if this.needPassword |
| 649 // is true. This is because the flag is used as an intention to get | 649 // is true. This is because the flag is used as an intention to get |
| 650 // password when it is available but not a mandatory requirement. | 650 // password when it is available but not a mandatory requirement. |
| 651 console.warn('Authenticator: No password scraped for SAML.'); | 651 console.warn('Authenticator: No password scraped for SAML.'); |
| 652 } else if (this.needPassword) { | 652 } else if (this.needPassword) { |
| 653 if (this.samlHandler_.scrapedPasswordCount == 1) { | |
| 654 // If we scraped exactly one password, we verify that it and complete | |
| 655 // the authentication right away. | |
| 656 var passwords = this.samlHandler_.getConsolidatedScrapedPasswords_(); | |
| 657 this.verifyConfirmedPassword(passwords[0]); | |
|
xiyuan
2016/05/04 19:35:04
getConsolidatedScrapedPasswords_ is private and we
afakhry
2016/05/04 20:16:15
Done.
| |
| 658 return; | |
| 659 } | |
| 660 | |
| 653 if (this.confirmPasswordCallback) { | 661 if (this.confirmPasswordCallback) { |
| 654 // Confirm scraped password. The flow follows in | 662 // Confirm scraped password. The flow follows in |
| 655 // verifyConfirmedPassword. | 663 // verifyConfirmedPassword. |
| 656 this.confirmPasswordCallback(this.email_, | 664 this.confirmPasswordCallback(this.email_, |
| 657 this.samlHandler_.scrapedPasswordCount); | 665 this.samlHandler_.scrapedPasswordCount); |
| 658 return; | 666 return; |
| 659 } | 667 } |
| 660 } | 668 } |
| 661 | 669 |
| 662 this.onAuthCompleted_(); | 670 this.onAuthCompleted_(); |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 827 Authenticator.AuthMode = AuthMode; | 835 Authenticator.AuthMode = AuthMode; |
| 828 Authenticator.SUPPORTED_PARAMS = SUPPORTED_PARAMS; | 836 Authenticator.SUPPORTED_PARAMS = SUPPORTED_PARAMS; |
| 829 | 837 |
| 830 return { | 838 return { |
| 831 // TODO(guohui, xiyuan): Rename GaiaAuthHost to Authenticator once the old | 839 // TODO(guohui, xiyuan): Rename GaiaAuthHost to Authenticator once the old |
| 832 // iframe-based flow is deprecated. | 840 // iframe-based flow is deprecated. |
| 833 GaiaAuthHost: Authenticator, | 841 GaiaAuthHost: Authenticator, |
| 834 Authenticator: Authenticator | 842 Authenticator: Authenticator |
| 835 }; | 843 }; |
| 836 }); | 844 }); |
| OLD | NEW |