Every repository with this icon (
Every repository with this icon (
| Description: | Standard authentication stack for Rails using Twitter to log in. edit |
-
I've decided that Grackle is close enough to my lightweight and "not too much magic" approach to API access that it should be the default way people access Twitter through TwitterAuth. I will be bringing in Grackle as a dependency and utilizing it instead of the current dispatcher. I will also, however, be wrapping it up so that everything still works the same and providing the same HTTP verb methods as currently. You'll just also be able to do something like this:
user.twitter.statuses.replies?(:since_id => 123)Comments
-
I had a dig through the code, and a number of things indicate that twitter's search methods are not supported. For instance, the base_url is https://twitter.com, whereas the search API says that it's necessary to use search.twitter.com:
http://apiwiki.twitter.com/Twitter-Search-API-Method%3A-search
Thanks,
DaveComments
The Search API doesn't require authentication so I haven't worked in any support for it yet. You can just make straight up calls to the API like this:
require 'open_uri' require 'json' def twitter_search(query) JSON.parse(open("http://search.twitter.com/search.format?q=#{CGI.escape(query)}").read) endThat's a simple example, but it works. I will be adding Twitter Search support as an eventual result of #1 because I will be integrating search into my TwitterDispatch gem. Hope that helps.
-
1 comment Created 6 months ago by sishenCatch the exception while twitter service is under maintaince.0.2.0xSometimes twitter is under maintaince and as a result the app can't request the oauth token. We need to do something instead of directly raising the exception to the top, such as catch the exception in the SessionsController#new,
rescue Exception => e
authentication_failed("We're currently experiencing issues with Twitter's OAuth Service. Please try later.") and returnComments
-
Make the TwitterAuth functionality a mixin instead of a superclass, so that TwitterAuth can be more configurable and added in a less strict manner.
Example:
class User < ActiveRecord::Base twitter_authenticated :via => :oauth endComments
This is perfect for those of us wanting to add twitter login as an optional way to authenticate, in addition to traditional login with username and password
Ok, this is something I'd like to tackle in the near future. This is my proposed laundry list, tell me if I'm missing anything:
- Allow TwitterAuth to be added to a model via a
twitter_authenticatedmixin - Allow enough configuration to keep it from conflicting with other authentication solutions. (I might namespace all of the functionality into a proxied twitter object that does more than the current dispatcher).
- Remove the validations from being required (this way apps that don't solely use TwitterAuth can have blank fields for some of those fields).
- Support legacy versions of TwitterAuth by making the GenericUser automatically call
twitter_authenticated - Tweak the generator to take advantage of the new refactor.
Obviously this isn't a small task and I'll be starting work on it in a
mixinbranch sometime soon. - Allow TwitterAuth to be added to a model via a
-
Support Twitter-Compatible APIs alongside Twitter in the same application (Laconi.ca, Present.ly).
Comments
-
So I think twitter-auth is great. However I have run into one issue trying to cache twitter data in the database. I find that I have to have a separate twitter_user table to store user information about friends and followers. If I try and drop it into the users table created by twitter-auth I get validation errors like 'login required'. This means my current db caching of twitter data is a little un-DRY. I wonder if it might be valuable to extract the twitter user data available over the wire to a separate table, and then have the data needed for oauth in a separate table?
Comments
-
is it possible to change the migration to look like this:
create_table :users. :id => false do |t| t.integer :id, :limit => 8 # force column to bigint in mysql ... end add_index :users, :id, :unique => trueif this is possible, then we can have the id in the users table match the id we get from twitter.
we'd have to change the GenericUser model a bit to handle this, but i think it should work.Comments
-
profile_background_tiled is not updating - Attribute name mismatch
1 comment Created 5 months ago by swards -
I followed the instructions here:
http://intridea.com/2009/3/23/twitter-auth-for-near-instant-twitter-apps
and
http://wiki.github.com/mbleigh/twitter-auth/twitterauth-and-the-oauth-security-advisoryWhen I log in, the records are pulled from Twitter and stored in the db just fine.
However, I'm not logged in. "current_user" is always nil.Any suggestions?
Comments
-
oauth_callback doesn't seem to be honored by twitter
0 comments Created 10 days ago by openfaceEven though I have oauth_callback defined for my environment, Twitter insists on redirecting back to the callback URL that they have defined for my OAuth client.
Comments











