Authentication woes, newby

2 views
Skip to first unread message

ossreleasefeed

unread,
Oct 27, 2009, 10:20:34 AM10/27/09
to twitter4r-users
Hi there everyone,

I am playing around with the Twitter4R lib and have got everything set-
up successfully and the calls to Twitter are succeeding but I have a
strange issue I hope someone can help me with.

First a question, does the client.authenticate? method call actually
log in a user or merely check whether the user exists on Twitter and
that the credentials match?

Now for the problem, when I use:

client = Twitter::Client.new(:login => 'username', :password =>
'password')

and the use:

client.my(:info)

I always get some default user returned no matter which
username:password combinations I use.

{:_csrf_token=>"9KXpODjHvl93MmGifjBFRJbIOVZn9dlIRYOor6szDdo=", :session_id=>"b01c39b91acb525cee70992f081786fe", :user=>#<Twitter::User:
0x52484ac @profile_text_color="000000", @statuses_count=0,
@notifications=false, @location=nil,
@profile_sidebar_border_color="87bc44",
@profile_background_color="9ae4e8", @friends_count=0, @utc_offset=nil,
@following=false, @profile_sidebar_fill_color="e0ff92", @name="Jose
Italo", @time_zone=nil, @followers_count=12,
@profile_image_url="http://s.twimg.com/a/1255715644/images/
default_profile_6_normal.png", @client=#<Twitter::Client:0x524809c
@login="openworlddb", @password="XXXX">,
@profile_background_tile=false, @url=nil, @id=82946051,
@description=nil, @profile_link_color="0000ff", @favourites_count=0,
@protected=false, @screen_name="show", @created_at="Fri Oct 16
18:51:43 +0000 2009", @profile_background_image_url="http://
s.twimg.com/a/1255715644/images/themes/theme1/bg.png">}

Any ideas? What am I missing here?

Thanks!
Schalk

SP

unread,
Oct 30, 2009, 1:03:15 PM10/30/09
to twitter4r-users
Hi Schalk,

> First a question, does the client.authenticate? method call actually
> log in a user or merely check whether the user exists on Twitter and
> that the credentials match?
Twitter::Client#authenticate?(user, pass) only verifies the
credentials passed in. It doesn't not create a persistent
authenticated connection.

> Now for the problem, when I use:
> client = Twitter::Client.new(:login => 'username', :password =>
> 'password')
> and the use:
> client.my(:info)
> I always get some default user returned no matter which
> username:password combinations I use.
> Any ideas? What am I missing here?
Could you let me know which version of Twitter4R you are using?

In Twitter4R v0.3.2 (the latest gem available from gemcutter.org) I
did the following:

params = {:login => "mylogin", :password => "mypassword"}
client = Twitter::Client.new(params)
client.authenticate?(params[:login], params[:password])
=> true
client.my(:info)
=> #<Twitter::User:0x28d4490 @friends_count=110,
@profile_link_color="FF0000", ..., @screen_name="SusanPotter",
@profile_background_tile=false>

Can you make sure authenticate? returns true with your credentials and
then let me know the version of the Twitter4R gem you are using.

Thanks,
Susan
Reply all
Reply to author
Forward
0 new messages