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

Unified Diff: remoting/webapp/oauth2.js

Issue 12905012: Webapp changes to support third party authentication (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase, update patch Created 7 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/webapp/manifest.json ('k') | remoting/webapp/plugin_settings.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/oauth2.js
diff --git a/remoting/webapp/oauth2.js b/remoting/webapp/oauth2.js
index 752c880c26dd1e846ec0f604b9620ab754445304..69c6d2dfa109e4181941c7a4788bcd13c8a55da5 100644
--- a/remoting/webapp/oauth2.js
+++ b/remoting/webapp/oauth2.js
@@ -308,22 +308,12 @@ remoting.OAuth2.prototype.refreshAccessToken_ = function(onDone) {
};
/**
- * @private
- * @return {string} A URL-Safe Base64-encoded 128-bit random value. */
-remoting.OAuth2.prototype.generateXsrfToken_ = function() {
- var random = new Uint8Array(16);
- window.crypto.getRandomValues(random);
- var base64Token = window.btoa(String.fromCharCode.apply(null, random));
- return base64Token.replace(/\+/g, '-').replace(/\//g, '_').replace(/=/g, '');
-};
-
-/**
* Redirect page to get a new OAuth2 Refresh Token.
*
* @return {void} Nothing.
*/
remoting.OAuth2.prototype.doAuthRedirect = function() {
- var xsrf_token = this.generateXsrfToken_();
+ var xsrf_token = remoting.generateXsrfToken();
window.localStorage.setItem(this.KEY_XSRF_TOKEN_, xsrf_token);
var GET_CODE_URL = this.getOAuth2AuthEndpoint_() + '?' +
remoting.xhr.urlencodeParamHash({
« no previous file with comments | « remoting/webapp/manifest.json ('k') | remoting/webapp/plugin_settings.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698