"Redirecting you back to the application" never finishes redirecting

oauth

#1

Hi all,

For some reason, when I host my application on AWS or Heroku, the “Sign in with Twitter” button never redirects back to my webpage. This is strange, because it DOES redirect when I run the website in localhost. In other words, everything works fine when I deploy the WAR file in localhost, but the application messes up by not redirecting on AWS. To see the error, see my application: http://sample-env.vzqeyzumtm.us-west-2.elasticbeanstalk.com/

I am using Twitter4j with a Tomcat server.

Can anyone help? Thanks.


#2

Still need help.


#3

It’s correctly redirecting back to your application which is then throwing an error. Check your Lambda logs/configuration.

This is where it redirect to and the error response.

http://sample-env.vzqeyzumtm.us-west-2.elasticbeanstalk.com/callback?oauth_token=K-24LQAAAAAA0_GEAAABXH6PX5A&oauth_verifier=3eq4yv4CMLXOYHWdeL8LOZg1fPI4CjEy
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>502 Proxy Error</title>
</head><body>
<h1>Proxy Error</h1>
<p>The proxy server received an invalid
response from an upstream server.<br />
The proxy server could not handle the request <em><a href="/callback">GET&nbsp;/callback</a></em>.<p>
Reason: <strong>Error reading from remote server</strong></p></p>
</body></html>

#4

You were right, thanks. The problem wasn’t that it wasn’t redirecting. Rather, the problem was that there was an exception when I tried to write the user’s credentials to my DB. Solved.


#5