0

私は、特定のビデオのための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を見つけようとしています。これどうやってやるの?

答えて

0

これは一種の似たこの質問にある:Deploying a node.js TCP server on heroku

は基本的に私はそれがうまくいくとは思いません。私はこれをやってみた:

 LocalServerReceiver localReceiver = new LocalServerReceiver.Builder().setHost("myappname.herokuapp.com").setPort(80).build(); 

しかし、ちょうどjava.net.BindExceptionエラーを取得してしまった。

関連する問題