2

I have a problem with a website I'm currently working on.

I have added a Tweet box to my page for the user to tweet about the current article. If the user submits from the Tweet box and is not currently logged in or is not connected with my site, he/she gets a popup from twitter asking for username/password and/or if he/she accepts the connection with my site.

If the user accepts the popup is closed and all is good, if the user declines the window is just closed and the tweet remains a dream of what could have been.

So far so good, But! My site is mainly aimed at smartphones (in particular iPhone), and if the user adds my site to the home screen (which I recommend) then the twitter popup fills the whole app window. This I can understand, and everything works out if the user accepts.

If, on the other hand the user declines, there is no window for the button to close so noting happens. My webapp is running fullscreen and standalone so doesn’t even have a back button. So if the user doesn’t accept the twitter connect, he/she basically needs to restart the app to get avay from the “popup”.

So (finally ;) ) my question is this; is there a twitter page that performs the connect authentication that is not required to be in a popup? A page that basically sends you back to the callback url on both accept and cancel? Or is there a different approach that I have over looked?

Looking forward to some helpful tips!

EDIT


I was suggested The standard OAuth flow and Web intents, the problem is that the app needs to be client code/javascript only. This makes The standard OAuth flow impossible because it sends application secrets over http/https wich makes me put the secrets in the javascript ( I might be somewhat of a hobbyist programmer but there are limits ;) ).

Web intent pages don't have a cancel/back button so I'm still stuck if the user dont want to connect and is running my app in stanalone mode.

I guess I should have included this in the original post, thanks anyway for the suggestions.

ThinkingStiff
  • 64,767
  • 30
  • 146
  • 239
Karl Johan
  • 4,012
  • 1
  • 25
  • 36

1 Answers1

3

The standard OAuth flow for Twitter does not require a popup. You can instead redirect the current window. You will then have to process the the form submit yourself and post the status through your server.

You might also checkout Web Intents. The user posts the tweet from a mobile optimized twitter.com page.

abraham
  • 46,583
  • 10
  • 100
  • 152
  • The problem is that OAuth flow is only secure on https wich is not available here. Web intent doesnt seem to have a cancel button, so I'm still stuck when my app runs standalone – Karl Johan May 06 '11 at 04:25
  • Well actually, this app is javascript only. Due to the restraints beyond my control, I can not useany serverside code, so it's not only https but rather serverside code. Anyway I cannot send/recive application secrets with javascript. I guess that I might have to make do without Twitter – Karl Johan May 06 '11 at 05:57
  • I am going to accept this answer. Though it doesn't answer my exact question, it is the preffered way to do this. I think it can help others. – Karl Johan May 25 '11 at 13:49