I have followed the steps defined in the following link for twitter oauth implementation.
https://docs.google.com/View?docID=dcf2dzzs_2339fzbfsf4
Its working fine when i run through web browser but i want a user should be able to update status of twitter account through gmail chat i.e. he should only be authenticated once through web then he should be able to send the status message through gmail chat and his twitter account should be updated
How can i inegrate this because gmail id can be different from twitter id?
Please guide.
When you authenticate with twitter using oauth your given credentials you can store and use later when posting updates.
Try using this library,
http://emmense.com/php-twitter/
Cheers
This article had everything I needed to set up a Twitter-posting bot that authenticates with OAuth: http://masnun.com/blog/2010/04/30/setting-up-twitter-bots-with-oauth/
This might be help, I also face the same issue before, and it is now solved.
http://ruckuus.wordpress.com/2009/09/04/pecl-and-twitter-oauth/
Basically, after you ask a grant from user, then you access /access_token you will get authenticated oauth_token, and oauth_token_secret which is persistent. so further on you don't need access to access_token anymore if you already had these variables.
Storing it is very simple, either to put them in database, cookies (if you use web application) or in a plaintext.
Related
im using the Google Api PHP v0.5.0(http://code.google.com/p/google-api-php-client/) , to access to Google Analytics, im able to connect using the token (oauth) without any problem, but when i try to switch to other account , its retrieves me the data from the first account i logged in, each account has their own client id, client secret, developer key, and token, so when i switch to other account i just create a instance using the information of that specific account
i realized that are some cookies from google but i delete them and still retrieves me data from the first account i logged, i dont see any function to destroy session or logout or something
i figure out the problem, actually wasnt any problem, the token you get from google is from the account you are logged in, because i "allow" the application with the same account, i was generate the token from the same user each time, i didnt understand that well until now
I am looking to see how we can allow a user to connect with their Google Analytic's User ID and connect with our app and we can get the information from their account.
I am looking forward to some articles or any library thats build around the same.
I will be using PHP and MySQL. Do you suggest any other Database than MySQL ?
You can start with a database to keep things simple and since you are not looking to store too much of historical data. The link below should get you started with all the required libraries and documentation.
https://developers.google.com/analytics/devguides/reporting/core/v2/gdataAuthentication
Go for the web client based authentication model rather than the service account model.
This will cause the api to redirect your user to google authorization page and your app will be given privileges to user account.
Make sure you save the refresh token when it redirects back to you app.
Please note that the refresh token only get sent for the very first time you app asks for permission and not after that.
I just wanted to make sure I had this understood correctly.
When I authenticate a Twitter account, I am given back the access_key and access_secret.
If I want to permanently retain this user's Twitter account authentication between logins, do I store the access_key and access_secret in the database with the user's account info, and then load those 2 tokens into the session whenever this user logs back in for API access without authenticating with Twitter services upon each login?
Thanks guys
Looks like that'd be a yes. I ended up finding a helpful article
http://net.tutsplus.com/tutorials/php/how-to-authenticate-users-with-twitter-oauth/
So I am trying to let my customers login in with Twitter, and just twitter.
Twitter says "You should never store a password for your users again", but how am I going to reauthenticate my users with twitters API?
If I resend the user to twitter after they have deleted their session, twitter asks the user again if they want to give acces to my application.
Is it at all possible to have seamless intergration with twitter accounts without ever storing local user data?
EDIT
It seems that the question is not extremely clear. What I have experienced using for example http://forum.jquery.com/. They use OpenID. I click "Login with google". I get redirected to google. Google remebers I gave acces to Zoho once and instantly sends me back to forums.jquery.com, this time with an access_token for zoho to authenticate me with. I have no persistent data with Zoho. Yet they can log me in.
What twitter with OAuth does is the following. A user comes to my site, they click "Login with twitter" and get redirected to twitter.
Twitter asks them again whether they want to give the application access to their data. Instead of the immediate redirect google does.
Is it possible for twitter to immediatly redirect the user to me. Is there a setting for me I am overlooking.
Send users to https://api.twitter.com/oauth/authenticate instead of https://api.twitter.com/oauth/authorize. If the user is already signed into Twitter and has previously authenticated with your app they will be redirected without seeing an allow/deny prompt.
What you store from Twitter are the user's TOKEN and user's SECRET. Those values are issued by Twitter (or any oauth provider) when you are in the process of oauth authentication.
You can get the idea using this library in PHP:
https://github.com/abraham/twitteroauth
Or this one in Ruby:
https://github.com/jnunemaker/twitter
The process is quite straightforward once you tried with any real example. It is not difficult at all.
There are also some nice screencasts here:
http://railscasts.com/episodes/241-simple-omniauth
http://railscasts.com/episodes/235-omniauth-part-1
http://railscasts.com/episodes/236-omniauth-part-2
Have you actually read the API?
Read the getting started page, you don't store passwords you store access tokens for the user. And if you want people to log in and register your going to have to store some data ;-)
I had this problem exactly and solved it using setAuthorizedUrl method - for more details see here http://www.evilprofessor.co.uk/359-sign-in-with-twitter-using-zend-framework/
This tutorials might Helpful for you.
Twitter API connect using oAuth
Cristian comment is what I was looking for.
You have to save those values in any persistent storage, if not, your users will always need to go Twitter again.
Shame that twitter doesn't recognize that the users have already allowed my app and redirects automatically
I am trying to write an php twitter script which will be run by crontab, what the script does is to get the tweets from a dedicated twitter account.
I have looked at some of the php twitter oauth libraries, all of them seem to use redirect to a twitter page to get a token, then goes back to a callback link. In my case I don't want to have any user interaction at all.
Could anyone please tell me what I should do?
Regards
James
Twitter provides a single access token feature on dev.twitter.com designed just for this use.
http://dev.twitter.com/pages/oauth_single_token
You shouldn't need to be using the Twitter API at all. Tweets are public resources, accessible via HTTP.
Here's the official Twitter account's last 10 tweets, available as JSON or XML.
I use oAuth for my Twitter bot. I got the oAuth token by making a web interface and signing it up. I then pass the token with my calls.
I use Abraham's oAuth library:
http://twitteroauth.labs.poseurtech.com/connect.php
You can use the example from the library to get the token. Just have it echo the token from the $_SESSION it creates on the callback.
Unless the account is private, you don't need to be authenticated.
Or use OAuth, and authenticate using an admin screen.
We do not currently expire access
tokens. You access token will be
invalid if a user explicitly rejects
your application from their settings
or if a Twitter admin suspends your
application. If your application is
suspended there will be a note on your
application page saying that it has
been suspended.
http://apiwiki.twitter.com/OAuth-FAQ