私は、特定のビデオのためのYouTubeのコメントをダウンロードするJavaベースのWebアプリケーションを持っています。それはすべてローカルでうまく動作しますが、私はそれをアマゾンクランドに展開すると、コールバックのURLの問題のために認証プロセスですべてのエラーを出すと述べています。GoogleOAuthリダイレクトURL、LocalServerReceiverポート番号
GoogleAuthorizationCodeFlow flow = new GoogleAuthorizationCodeFlow.Builder(
HTTP_TRANSPORT, JSON_FACTORY, clientSecrets, scopes).setCredentialDataStore(datastore)
.build();
// Build the local server and bind it to port xxxxx
LocalServerReceiver localReceiver = new LocalServerReceiver.Builder().setPort(15555).build();
// Authorize.
Credential credential = new AuthorizationCodeInstalledApp(flow, localReceiver).authorize("user");
);
return credential;
上記のコードスニペットは、youtube devウェブサイトから取得しました。
ユーチューブからアクセストークンを取得localReciver
は、ポート15555上で動作するので、私の質問は、何の道localReceiver
がありますされていないつもりが唯一のポートとして私のサイトは、Amazonクラウド上にある特定の外部からacessible 80をユーチューブからの応答を取得することです。 。右?
つまり、redirect_uriがredirect_uri=http://mysite.elasticbeanstalk.com:15555/Callback&response_type=code&scope=https://www.googleapis.com/auth/youtube.force-ssl
であるとしたら、それはポート15555にあるので動作しません。私はこれを頭に入れて、solutinを見つけようとしています。これどうやってやるの?