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

Unified Diff: remoting/webapp/oauth2_callback.js

Issue 23891005: Fix OAuth "trampoline" content script to send a message with the oauth results rather than using a … (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Refresh window on new refresh token Created 7 years, 3 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/oauth2_callback.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/oauth2_callback.js
diff --git a/remoting/webapp/oauth2_callback.js b/remoting/webapp/oauth2_callback.js
deleted file mode 100644
index 35179354dc2401cee2c5be6b5cf48d7280361041..0000000000000000000000000000000000000000
--- a/remoting/webapp/oauth2_callback.js
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-/**
- * @fileoverview
- * OAuth2 class that handles retrieval/storage of an OAuth2 token.
- *
- * Uses a content script to trampoline the OAuth redirect page back into the
- * extension context. This works around the lack of native support for
- * chrome-extensions in OAuth2.
- */
-
-'use strict';
-
-var remoting = remoting || {};
-
-function retrieveRefreshToken() {
- var query = window.location.search.substring(1);
- var parts = query.split('&');
- var queryArgs = {};
- for (var i = 0; i < parts.length; i++) {
- var pair = parts[i].split('=');
- queryArgs[pair[0]] = pair[1];
- }
-
- if ('code' in queryArgs && 'state' in queryArgs) {
- remoting.settings = new remoting.Settings();
- var oauth2 = new remoting.OAuth2();
- oauth2.exchangeCodeForToken(queryArgs['code'], queryArgs['state'],
- function() {
- window.location.replace(chrome.extension.getURL('main.html'));
- });
- } else {
- window.location.replace(chrome.extension.getURL('main.html'));
- }
-}
-
-window.addEventListener('load', retrieveRefreshToken, false);
« no previous file with comments | « remoting/webapp/oauth2_callback.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698