I have a java based web app which downloads youtube comments for a given video. It works all fine locally but when i deploy it to amazon clound stated giving me all the erros in the authentication process due to callback url issues.
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;
Above code snippet was taken from the youtube dev website.
My question is since the localReciver
which gets the access token from the youtube, runs on port 15555, there's no waylocalReceiver
is gonna get the response from youtube as only port 80 acessible from outside given my site is on amazon cloud..right?
So in other words if i had my redirect_uri as redirect_uri=http://mysite.elasticbeanstalk.com:15555/Callback&response_type=code&scope=https://www.googleapis.com/auth/youtube.force-ssl
, is not going to work since it's on port 15555. I'm trying to wrap my head over this to find a solutin. How do you do this?