I am using this twitter api library and so far everything is great. My problem (well not really a problem more a user experience) is that every time you want to sign in with twitter you need to open a popup.
Right now the flow is this:
- User clicks on the sign in with twitter logo on my page.
- Javascript induced popup comes up with the the twitter Oauth stuff on it. If you are logged in all it says is login and cancel. If you are not it has login fields.
- If everything is good it goes to a callback url that I supply. does a bunch of stuff and then..
- I call window.opener and pass the authenticated info and from there I close the window.
This was surprisingly easy to implement and works great. I’m wondering if the twiiter login process can be a little more like the facebooks which would be this.
- User clicks on the sign in with twitter logo on my page.
- If the user is logged in and has autorized the app the popup window will popup go away instantly and chuck the user data back to my page.
I do realize that I am using a php library for twitter and the facebook flow is from the javascript side but I am wondering if I can detect, with php, if the user has already allowed the app and is signed in, for them bypass the extra signin/cancel click.
Try using the "Sign in with Twitter" flow. If the user is already authenticated, it’s a one click operation. The linked doc above has a flowchart and description of the process, but I’ll list the steps here (with emphasis added) as well, and link in the relevant API pages:
Hopefully this fits the bill and will work for you.