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:
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.
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.
This will allow you to access the Twitter developer portal. 2. Head over to the Twitter Dev Site and Create a New Application Navigate to apps.twitter.com, sign in, and create a new application. After that, fill out all the app details and… …Voila! You now should be able to access all the required API Keys and authorization credentials.
Depending on the app, you may be presented with a consent dialog from Twitter asking you to authorize the app to use your account or you may be prompted to grant the app access to the Twitter accounts on your iOS device. You can review the various permissions you are granting to the app.
You're now ready to use Twitter for authentication in your app. The provider will be listed on the Authentication screen. From there, you can edit or delete this provider configuration. App Service Authentication / Authorization overview. Tutorial: Authenticate and authorize users end-to-end in Azure App Service
So let’s get started. Wait, but what are the requirements? In order to begin using the Twitter API, you’ll need an account with Twitter that will get you access to an API Key (Consumer Key). Getting credentials to the Twitter API is really simple.
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:
"Sign in with Twitter" is the pattern of authentication that allows users to connect their Twitter account with third-party services in as little as one click. It utilizes OAuth and although the flow is very similar, the authorization URL and workflow differs slightly as described below.
The normal flow dictates that applications send request tokens to oauth/authorize in Twitter's implementation of the OAuth Specification. To take advantage of "Sign in with Twitter", applications should send request tokens received in the oauth_token parameter to oauth/authenticate instead.
The oauth/authenticate method will act in different ways depending on the status of the user and their previous interaction with the calling application:
If the user is logged into twitter.com and has already approved the calling application, the user will be immediately authenticated and returned to the callback URL.
If the user is not logged into twitter.com and has already approved the calling application, the user will be prompted to login to twitter.com then will be immediately authenticated and returned to the callback URL.
If the user is logged into twitter.com and has not already approved the calling application, the OAuth authorization prompt will be presented. Authorizing users will then be redirected to the callback URL.
If the user is not logged into twitter.com and has not already approved the calling application, the user will be prompted to login to twitter.com then will be presented the authorization prompt before redirecting back to the callback URL.
Hopefully this fits the bill and will work for you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With