2016-06-13 14 views
0

Googleドライブファイルをリストし、PhoneGapサーバーでテストするhtml5ページを開発しました。 http://localhost:3000を設定してOauth2を作成したので、すべて正常に動作します。 SHA1とAndroid App + Cordova + HTML5 + GoogleドライブApi

私はAPKファイルをテストしようとした、(また、GoogleドライブコンソールでのOAuth2に設定された)、私はエラーを受け取っ:

Refused to display 'https://accounts.google.com/o/oauth2/auth?client_id=<KEY>' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'. I understand that this error is because the Oauth2 doesn't expect the origin. But the Origin is not http, if file know... (file:///android_asset/www/index.html). The GoogleAPI Console doesn't accept 'file' protocol... just 'http'.

どのように私はこの問題を解決することができますか?このSO後に与えられた解決策によれば

+0

あなたは私の答えを同様のSOで確認できます[質問](http://stackoverflow.com/questions/35746756/how-implement-google-drive-in-ionic-app/42412306#42​​412306) – JcDenton86

答えて

0

- Refused to display in an frame because it set 'X-Frame-Options' to 'SAMEORIGIN'、エラーに遭遇について:

さらに

This is not related to disabling security in chrome browser. I believe there might me some issues with my XAMPP Windows local host.Deploying the same application in node.js server or hosting Dropbox/Google Drive as a web app also works fine.

、GoogleのAPIにアクセスするためのOAuth 2.0を使用してbasic stepsからステップ#2で説明したように、要求を行いますGoogle認可サーバーからアクセストークンを取得します。

  • JavaScriptアプリケーションは、ブラウザがGoogleの
  • Webサービス要求を使用しています何のブラウザを持っていないデバイスにインストールアプリケーションにリダイレクト使用してアクセストークンを要求することがあります:次のようにリクエストをする方法があります。

使用できるサンプルシナリオは、マニュアルに記載されています。

関連する問題