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

Side by Side Diff: remoting/webapp/crd/js/third_party_token_fetcher.js

Issue 945033002: Updated XHR API so call sites are more descriptive. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@xhr-test
Patch Set: Created 5 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
« no previous file with comments | « remoting/webapp/crd/js/session_connector_impl.js ('k') | remoting/webapp/crd/js/xhr.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 /** 5 /**
6 * @fileoverview 6 * @fileoverview
7 * Third party authentication support for the remoting web-app. 7 * Third party authentication support for the remoting web-app.
8 * 8 *
9 * When third party authentication is being used, the client must request both a 9 * When third party authentication is being used, the client must request both a
10 * token and a shared secret from a third-party server. The server can then 10 * token and a shared secret from a third-party server. The server can then
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 this.onThirdPartyTokenFetched_(token, sharedSecret); 125 this.onThirdPartyTokenFetched_(token, sharedSecret);
126 }; 126 };
127 127
128 /** 128 /**
129 * Build a full token request URL from the parameters in this object. 129 * Build a full token request URL from the parameters in this object.
130 * 130 *
131 * @return {string} Full URL to request a token. 131 * @return {string} Full URL to request a token.
132 * @private 132 * @private
133 */ 133 */
134 remoting.ThirdPartyTokenFetcher.prototype.getFullTokenUrl_ = function() { 134 remoting.ThirdPartyTokenFetcher.prototype.getFullTokenUrl_ = function() {
135 return this.tokenUrl_ + '?' + remoting.xhr.urlencodeParamHash({ 135 return this.tokenUrl_ + '?' + remoting.Xhr.urlencodeParamHash({
136 'redirect_uri': this.redirectUri_, 136 'redirect_uri': this.redirectUri_,
137 'scope': this.tokenScope_, 137 'scope': this.tokenScope_,
138 'client_id': this.hostPublicKey_, 138 'client_id': this.hostPublicKey_,
139 // The webapp uses an "implicit" OAuth flow with multiple response types to 139 // The webapp uses an "implicit" OAuth flow with multiple response types to
140 // obtain both the code and the shared secret in a single request. 140 // obtain both the code and the shared secret in a single request.
141 'response_type': 'code token', 141 'response_type': 'code token',
142 'state': this.xsrfToken_ 142 'state': this.xsrfToken_
143 }); 143 });
144 }; 144 };
145 145
(...skipping 22 matching lines...) Expand all
168 /** 168 /**
169 * Fetch a token from a token server using the identity.launchWebAuthFlow API. 169 * Fetch a token from a token server using the identity.launchWebAuthFlow API.
170 * @private 170 * @private
171 */ 171 */
172 remoting.ThirdPartyTokenFetcher.prototype.fetchTokenIdentityApi_ = function() { 172 remoting.ThirdPartyTokenFetcher.prototype.fetchTokenIdentityApi_ = function() {
173 var fullTokenUrl = this.getFullTokenUrl_(); 173 var fullTokenUrl = this.getFullTokenUrl_();
174 chrome.identity.launchWebAuthFlow( 174 chrome.identity.launchWebAuthFlow(
175 {'url': fullTokenUrl, 'interactive': true}, 175 {'url': fullTokenUrl, 'interactive': true},
176 this.parseRedirectUrl_.bind(this)); 176 this.parseRedirectUrl_.bind(this));
177 }; 177 };
OLDNEW
« no previous file with comments | « remoting/webapp/crd/js/session_connector_impl.js ('k') | remoting/webapp/crd/js/xhr.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698