views:

355

answers:

0

Building an actionscript Twitter client and using OAuth for the sign in process.

Having an extremely frustrating issue with the following error message. '403 Forbidden: The server understood the request, but is refusing to fulfill it.'

The following 2 steps ALWAYS work after I click my 'Sign In with Twitter' button, I make it to the Twitter OAuth sign in page so I have the correct request token, etc

1 successfully retrieve request token
2 navigate to Twitter's OAuth login page (following url isn't my actual URL but represents the actual path visible in the browser) http://www.mydomain.com/twitter/proxy.php?path=http%3A%2F%2Ftwitter.c...

But the ONLY way I can proceed further (ie clicking 'Sign In' on the Twitter Oauth sign in page) without getting the 403 error is if the browser has just launched BEFORE navigating to the Twitter OAuth sign in page.

Let me explain...
ie I have a separate duplicate compiled version of my application on my desktop where I click the 'Sign In with Twitter' button to start the login process. It targets the same php proxy script, retrieves the request token, then issues a navigate to URL command which launches a new browser window, or in this case, launches the browser.

Clicking signIn now works correctly, no 403 error

Other wise(if the browser has ALREADY been open BEFORE I get to the twitter OAuth Sign In page) I get the 403 forbidden message, even if the username-password fields are blank.

What gives? I am totally stumped.... This occurs in BOTH Safari and Firefox in OSX....so I can assume its NOT a browser issue Perhaps a cookie issue...or something to do with missing or incorrect HTTP referer in my php proxy??? any suggestions welcome...