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

Side by Side Diff: chrome/browser/resources/gaia_auth/main.js

Issue 12704002: Support for auth code based authentication flow for both app and web UI driven flow. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 function Authenticator() { 5 function Authenticator() {
6 } 6 }
7 7
8 Authenticator.getInstance = function() { 8 Authenticator.getInstance = function() {
9 if (!Authenticator.instance_) { 9 if (!Authenticator.instance_) {
10 Authenticator.instance_ = new Authenticator(); 10 Authenticator.instance_ = new Authenticator();
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 if (this.attemptToken_ == msg.attemptToken) { 103 if (this.attemptToken_ == msg.attemptToken) {
104 var msg = { 104 var msg = {
105 'method': 'completeLogin', 105 'method': 'completeLogin',
106 'email': this.email_, 106 'email': this.email_,
107 'password': this.password_ 107 'password': this.password_
108 }; 108 };
109 window.parent.postMessage(msg, this.PARENT_PAGE); 109 window.parent.postMessage(msg, this.PARENT_PAGE);
110 } else { 110 } else {
111 console.log('#### Authenticator.onMessage: unexpected attemptToken!?'); 111 console.log('#### Authenticator.onMessage: unexpected attemptToken!?');
112 } 112 }
113 } else if (msg.method == 'confirmAuthentication' &&
114 this.isInternalMessage_(e)) {
115 var msg = {
116 'method': 'completeAuthentication',
117 'email': msg.email,
118 'authCode': msg.authCode
119 };
120 window.parent.postMessage(msg, this.PARENT_PAGE);
113 } else { 121 } else {
114 console.log('#### Authenticator.onMessage: unknown message + origin!?'); 122 console.log('#### Authenticator.onMessage: unknown message + origin!?');
115 } 123 }
116 } 124 }
117 }; 125 };
118 126
119 Authenticator.getInstance().initialize(); 127 Authenticator.getInstance().initialize();
120 128
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698