Ruby xAuth support

I'm currently working in a service that has an API access through Oauth. I recently noted than Twitter will add support to xOauth, a lighter protocol intented for mobile and desktop access.

It's possible to add xAuth support for my site or is only a Twitter technology?

Thanks, Toño

Upvotes: 1

Views: 877

Answers (2)

Mukesh Singh Rathaur
Mukesh Singh Rathaur

Reputation: 13135

Yes, you can integrate xauth in your application.

Before doing this we have to start service by sending email to [email protected] for authenticating user via xauth. more details or registration and starting xauth follow this doc Resister app with twitter and send email to activate xauth service

Once you have done with above procedure use the following to authenticate user with xauth

consumer = OAuth::Consumer.new(CONSUMER_KEY, CONSUMER_SECRET, :site => site: 'https://api.twitter.com')
access_token = consumer.get_access_token(nil, {}, { :x_auth_mode => 'client_auth', :x_auth_username => 'Your-User-Name', :x_auth_password => 'Your-Password' })

http://www.robotmedia.net/2011/03/how-to-register-your-mobile-app-on-twitter-to-post-tweets/

Upvotes: 1

yonkeltron
yonkeltron

Reputation: 643

To be clear, XAuth is still very much OAuth! The only difference is that XAuth does not require browser redirection to obtain an OAuth token thus making it suitable for applications which can't or shouldn't force the user to use Twitter's site. XAuth adds a few parameters to the regular OAuth request to enable you to pass login credentials to Twitter directly. Learn more about it here. If you want to implement it for your project, you need only accommodate the additional parameters.

Upvotes: 2

Related Questions