Getting blank page from OAuth authorize URL


#1

Hi everyone

I’ve seeking for a solution of this problem since 3 months.

I have an application which uses Struts (Java Framework) and tries to connect to Twitter. I’m also using Twitter4j library.

Everytime I request a token for authorize an user, I get this URL: https://api.twitter.com/oauth/authorize?oauth_token=xxx

When I redirect, using the sendRedirect method from the HttpServletResponse class, this URL shows nothing. When I copy this URL into another tab or browser window it shows with no problem at all.

Is this a bug coming from Twitter or am I doing something wrong?

Please help.

Thanks.


#2

I’am in the same conditions Struts + Twitter4j, I am also using the sendRedirect but I doesn’t have this problem.
The only difference is that I open the page in a popup.


#3

What web browser are you using when this happens? When you issue the web-based redirect, are there any additional parameters or HTTP headers that get attached to the request? Could you try this through a proxy so you could monitor the actual traffic being sent in response to the redirect? How many seconds/milliseconds pass between getting the request token and sending the user to the authorize page? (shouldn’t make a difference but just asking)


#4

I was seeing this same problem using sample code (just thought I’d put the answer in case anyone needs it). I was being redirected to the access_token url rather than the authorize url. Turns out my DefaultOAuthProvider was setup incorrectly. It should be:

new DefaultOAuthProvider( request_token_url, access_token_url, authorize_url);


#5

same problem but with php