OAuth access token contains user ID

187 views
Skip to first unread message

Ollie

unread,
Apr 7, 2009, 11:09:16 AM4/7/09
to Twitter Development Talk
I am just looking into OAuth for the first time as a way of allowing
users to login to http://twitterleague.com. All I store in my database
is a user ID. So the basic authentication was used to verify
credentials and get the user ID.

I was looking at the oauth access token and it appears to start with
the users ID then a "-" then the random characters. For instance:
1234567-FAfdsafnjdksahf8wei9qyh89fxwqihfd839q...

All I want to know is can I just grab the beginning of the string or
will the tokens format change? As it would save me using the
verifyCredentials method.

Thanks

Ollie

Burhan TANWEER

unread,
Apr 7, 2009, 12:08:01 PM4/7/09
to twitter-deve...@googlegroups.com
Interesting, I would also like to know the answer
--
Sincerely,

Burhan Tanweer
www.explorewww.com
exp...@explorewww.com

Matt Sanford

unread,
Apr 7, 2009, 12:46:21 PM4/7/09
to twitter-deve...@googlegroups.com
Hi there,

    We currently use that user id as a speed optimization and we have no plans to remove it. However, since it's purely an optimization we may change it at some point if we find something to make it faster still. One of my changes currently waiting to go out will add a user_id and screen_name to the oauth callback so you can get ahold of this information easier. You can use part of the token for now but I would recommend using the new parameters when they launch (hopefully this week, but fire fighting can blocks deploys).

Thanks;
  — Matt Sanford / @mzsanford

Ollie Parsley

unread,
Apr 7, 2009, 2:51:12 PM4/7/09
to Twitter Development Talk
Thanks Matt.

Great idea to make it more effiecient.

Ollie

On Apr 7, 5:46 pm, Matt Sanford <m...@twitter.com> wrote:
> Hi there,
>
>      We currently use that user id as a speed optimization and we have  
> no plans to remove it. However, since it's purely an optimization we  
> may change it at some point if we find something to make it faster  
> still. One of my changes currently waiting to go out will add a  
> user_id and screen_name to the oauth callback so you can get ahold of  
> this information easier. You can use part of the token for now but I  
> would recommend using the new parameters when they launch (hopefully  
> this week, but fire fighting can blocks deploys).
>
> Thanks;
>    — Matt Sanford / @mzsanford
>
> On Apr 7, 2009, at 08:09 AM, Ollie wrote:
>
>
>
> > I am just looking into OAuth for the first time as a way of allowing
> > users to login tohttp://twitterleague.com. All I store in my database
Reply all
Reply to author
Forward
0 new messages