Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
workaround for OAuth2 using inline JavaScript causing conflicts with …
…Content Security Policy #102
- Loading branch information
Showing
3 changed files
with
28 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* Copyright 2011 Google Inc. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
// This script serves as an intermediary between oauth2.html and oauth2.js. | ||
|
||
// Get all query string parameters from the original URL. | ||
var url = decodeURIComponent(window.location.href.match(/from=([^&]+)/)[1]); | ||
var index = url.indexOf('?'); | ||
if (index !== -1) url = url.substring(0, index); | ||
|
||
// Derive adapter name from URI and then finish the process. | ||
var adapterName = OAuth2.lookupAdapterName(url); | ||
var finisher = new OAuth2(adapterName, OAuth2.FINISH); |