SlideShare una empresa de Scribd logo
1 de 28
Descargar para leer sin conexión
Configuring your Twitter4R App with OAuth


               Susan Potter
              (@SusanPotter)

                 Twitter4R
                 (@t4ruby)



               March 2011
OAuth. . .



    • sucks to configure
    • but it is better than users
      passing 3rd party apps their clear passwords
    • 3rd party apps don’t need
      to store passwords that are decryptable
OAuth. . .



    • sucks to configure
    • but it is better than users
      passing 3rd party apps their clear passwords
    • 3rd party apps don’t need
      to store passwords that are decryptable
OAuth. . .



    • sucks to configure
    • but it is better than users
      passing 3rd party apps their clear passwords
    • 3rd party apps don’t need
      to store passwords that are decryptable
In this screencast we will. . .


    • set up a new Twitter app
      https://twitter.com/apps/new

    • configure consumer tokens
      every app has a key and a secret; secret should be ’secret’

    • getting access tokens for user
      apps need to retrieve access tokens for each user

    • use access tokens
      store access tokens (key and secret) for each user
In this screencast we will. . .


    • set up a new Twitter app
      https://twitter.com/apps/new

    • configure consumer tokens
      every app has a key and a secret; secret should be ’secret’

    • getting access tokens for user
      apps need to retrieve access tokens for each user

    • use access tokens
      store access tokens (key and secret) for each user
In this screencast we will. . .


    • set up a new Twitter app
      https://twitter.com/apps/new

    • configure consumer tokens
      every app has a key and a secret; secret should be ’secret’

    • getting access tokens for user
      apps need to retrieve access tokens for each user

    • use access tokens
      store access tokens (key and secret) for each user
In this screencast we will. . .


    • set up a new Twitter app
      https://twitter.com/apps/new

    • configure consumer tokens
      every app has a key and a secret; secret should be ’secret’

    • getting access tokens for user
      apps need to retrieve access tokens for each user

    • use access tokens
      store access tokens (key and secret) for each user
Setting up a new Twitter app



    •   Go to twitter.com
    •   Login to your account
    •   Fill in form at twitter.com/apps/new
    •   Copy consumer tokens
Setting up a new Twitter app



    •   Go to twitter.com
    •   Login to your account
    •   Fill in form at twitter.com/apps/new
    •   Copy consumer tokens
Setting up a new Twitter app



    •   Go to twitter.com
    •   Login to your account
    •   Fill in form at twitter.com/apps/new
    •   Copy consumer tokens
Setting up a new Twitter app



    •   Go to twitter.com
    •   Login to your account
    •   Fill in form at twitter.com/apps/new
    •   Copy consumer tokens
Configuring consumer tokens


   # In a Rails 2.3 / 3.x app this might be
   # in: config/initializers/twitter4r.rb
   Twitter Client.configure do |config|
     config.oauth_consumer_token = CONSUMER_KEY
     config.oauth_consumer_secret = CONSUMER_SECRET
   end
Configuring consumer tokens


   # In a Rails 2.3 / 3.x app this might be
   # in: config/initializers/twitter4r.rb
   Twitter Client.configure do |config|
     config.oauth_consumer_token = CONSUMER_KEY
     config.oauth_consumer_secret = CONSUMER_SECRET
   end
Configuring consumer tokens


   # In a Rails 2.3 / 3.x app this might be
   # in: config/initializers/twitter4r.rb
   Twitter Client.configure do |config|
     config.oauth_consumer_token = CONSUMER_KEY
     config.oauth_consumer_secret = CONSUMER_SECRET
   end
Configuring consumer tokens


   # In a Rails 2.3 / 3.x app this might be
   # in: config/initializers/twitter4r.rb
   Twitter Client.configure do |config|
     config.oauth_consumer_token = CONSUMER_KEY
     config.oauth_consumer_secret = CONSUMER_SECRET
   end
Getting access tokens for a user, [1/2]

   # Using OAuth Ruby gem library helper in:
   # app/controller/application_controller.rb
   def redirect_to_twitter
     consumer = OAuth Consumer.new KEY, SECRET,

                  :site => “https://twitter.com”
     token = consumer.get_request_token
     redirect_to(token.authorize_url)
   end
Getting access tokens for a user, [1/2]

   # Using OAuth Ruby gem library helper in:
   # app/controller/application_controller.rb
   def redirect_to_twitter
     consumer = OAuth Consumer.new KEY, SECRET,

                  :site => “https://twitter.com”
     token = consumer.get_request_token
     redirect_to(token.authorize_url)
   end
Getting access tokens for a user, [1/2]

   # Using OAuth Ruby gem library helper in:
   # app/controller/application_controller.rb
   def redirect_to_twitter
     consumer = OAuth Consumer.new KEY, SECRET,

                  :site => “https://twitter.com”
     token = consumer.get_request_token
     redirect_to(token.authorize_url)
   end
Getting access tokens for a user, [1/2]

   # Using OAuth Ruby gem library helper in:
   # app/controller/application_controller.rb
   def redirect_to_twitter
     consumer = OAuth Consumer.new KEY, SECRET,

                  :site => “https://twitter.com”
     token = consumer.get_request_token
     redirect_to(token.authorize_url)
   end
Getting access tokens for a user, [2/2]
   # Using OAuth Ruby gem library in:
   # app/controller/oauth_controller.rb
   def create
     provider = params[:provider]
     case provider
     when ’twitter’
       # bla bla bla
     end
   end
   # Remember to add the routes:
   match ’oauth/:provider/callback’ => ’oauth#create’
Getting access tokens for a user, [2/2]
   # Using OAuth Ruby gem library in:
   # app/controller/oauth_controller.rb
   def create
     provider = params[:provider]
     case provider
     when ’twitter’
       # bla bla bla
     end
   end
   # Remember to add the routes:
   match ’oauth/:provider/callback’ => ’oauth#create’
Getting access tokens for a user, [2/2]
   # Using OAuth Ruby gem library in:
   # app/controller/oauth_controller.rb
   def create
     provider = params[:provider]
     case provider
     when ’twitter’
       # bla bla bla
     end
   end
   # Remember to add the routes:
   match ’oauth/:provider/callback’ => ’oauth#create’
Using access tokens


   # Pass in access key/secret tokens to
   # Twitter Client.new call for each user
   client = Twitter Client.new :oauth_access => {
         :key => ACCESS_KEY,
         :secret => ACCESS_SECRET }
   client.status(:post, “Tweet from my OAuth-ed app”)
Using access tokens


   # Pass in access key/secret tokens to
   # Twitter Client.new call for each user
   client = Twitter Client.new :oauth_access => {
         :key => ACCESS_KEY,
         :secret => ACCESS_SECRET }
   client.status(:post, “Tweet from my OAuth-ed app”)
Using access tokens


   # Pass in access key/secret tokens to
   # Twitter Client.new call for each user
   client = Twitter Client.new :oauth_access => {
         :key => ACCESS_KEY,
         :secret => ACCESS_SECRET }
   client.status(:post, “Tweet from my OAuth-ed app”)
Fin



      HTH, if you have more questions:
      twitter4r-users@googlegroups.com
Fin



      HTH, if you have more questions:
      twitter4r-users@googlegroups.com

Más contenido relacionado

Destacado (13)

Deploying distributed software services to the cloud without breaking a sweat
Deploying distributed software services to the cloud without breaking a sweatDeploying distributed software services to the cloud without breaking a sweat
Deploying distributed software services to the cloud without breaking a sweat
 
Understanding Uncertainty
Understanding UncertaintyUnderstanding Uncertainty
Understanding Uncertainty
 
Работа экспертов (ГИА-2010)
Работа экспертов (ГИА-2010)Работа экспертов (ГИА-2010)
Работа экспертов (ГИА-2010)
 
Learning objectives
Learning objectivesLearning objectives
Learning objectives
 
NAv6TF I Pv6 State Of Union Jan 2008
NAv6TF  I Pv6  State Of  Union  Jan 2008NAv6TF  I Pv6  State Of  Union  Jan 2008
NAv6TF I Pv6 State Of Union Jan 2008
 
Relentless Refactoring
Relentless RefactoringRelentless Refactoring
Relentless Refactoring
 
U 2010 Presentation 20070821a
U 2010 Presentation 20070821aU 2010 Presentation 20070821a
U 2010 Presentation 20070821a
 
Readme Driven Development
Readme Driven DevelopmentReadme Driven Development
Readme Driven Development
 
Scalaz By Example (An IO Taster) -- PDXScala Meetup Jan 2014
Scalaz By Example (An IO Taster) -- PDXScala Meetup Jan 2014Scalaz By Example (An IO Taster) -- PDXScala Meetup Jan 2014
Scalaz By Example (An IO Taster) -- PDXScala Meetup Jan 2014
 
Behaviour Driven Development
Behaviour Driven DevelopmentBehaviour Driven Development
Behaviour Driven Development
 
The D3 Toolbox
The D3 ToolboxThe D3 Toolbox
The D3 Toolbox
 
Masturbation nightfall-mydoctortells.com
Masturbation nightfall-mydoctortells.comMasturbation nightfall-mydoctortells.com
Masturbation nightfall-mydoctortells.com
 
Regaining Powerful Erection: Treatment of ED Without Medicines
Regaining Powerful Erection: Treatment of ED Without MedicinesRegaining Powerful Erection: Treatment of ED Without Medicines
Regaining Powerful Erection: Treatment of ED Without Medicines
 

Similar a Twitter4R OAuth

iPhoneアプリのTwitter連携
iPhoneアプリのTwitter連携iPhoneアプリのTwitter連携
iPhoneアプリのTwitter連携So Matsuda
 
OAuth and OEmbed
OAuth and OEmbedOAuth and OEmbed
OAuth and OEmbedleahculver
 
Building TweetEngine
Building TweetEngineBuilding TweetEngine
Building TweetEngineikailan
 
Using OAuth with PHP
Using OAuth with PHPUsing OAuth with PHP
Using OAuth with PHPDavid Ingram
 
OAuth 2.0 and Library
OAuth 2.0 and LibraryOAuth 2.0 and Library
OAuth 2.0 and LibraryKenji Otsuka
 
Spring Social - Messaging Friends & Influencing People
Spring Social - Messaging Friends & Influencing PeopleSpring Social - Messaging Friends & Influencing People
Spring Social - Messaging Friends & Influencing PeopleGordon Dickens
 
How to get data from twitter (by hnnrrhm)
How to get data from twitter (by hnnrrhm)How to get data from twitter (by hnnrrhm)
How to get data from twitter (by hnnrrhm)Hani Nurrahmi
 
Oauth2 and OWSM OAuth2 support
Oauth2 and OWSM OAuth2 supportOauth2 and OWSM OAuth2 support
Oauth2 and OWSM OAuth2 supportGaurav Sharma
 
An introduction to Laravel Passport
An introduction to Laravel PassportAn introduction to Laravel Passport
An introduction to Laravel PassportMichael Peacock
 
Implementing OAuth with PHP
Implementing OAuth with PHPImplementing OAuth with PHP
Implementing OAuth with PHPLorna Mitchell
 
Webapp security (with notes)
Webapp security (with notes)Webapp security (with notes)
Webapp security (with notes)Igor Bossenko
 
Data Synchronization Patterns in Mobile Application Design
Data Synchronization Patterns in Mobile Application DesignData Synchronization Patterns in Mobile Application Design
Data Synchronization Patterns in Mobile Application DesignEric Maxwell
 
UC2013 Speed Geeking: Intro to OAuth2
UC2013 Speed Geeking: Intro to OAuth2UC2013 Speed Geeking: Intro to OAuth2
UC2013 Speed Geeking: Intro to OAuth2Aaron Parecki
 
APIdays Paris 2018 - Learning the OAuth Dance (Without Stepping on Anyone's T...
APIdays Paris 2018 - Learning the OAuth Dance (Without Stepping on Anyone's T...APIdays Paris 2018 - Learning the OAuth Dance (Without Stepping on Anyone's T...
APIdays Paris 2018 - Learning the OAuth Dance (Without Stepping on Anyone's T...apidays
 
OAuth2 Best Practices in Native Apps
OAuth2 Best Practices in Native AppsOAuth2 Best Practices in Native Apps
OAuth2 Best Practices in Native AppsJeff Fontas
 

Similar a Twitter4R OAuth (20)

iPhoneアプリのTwitter連携
iPhoneアプリのTwitter連携iPhoneアプリのTwitter連携
iPhoneアプリのTwitter連携
 
OAuth and OEmbed
OAuth and OEmbedOAuth and OEmbed
OAuth and OEmbed
 
Building TweetEngine
Building TweetEngineBuilding TweetEngine
Building TweetEngine
 
Some OAuth love
Some OAuth loveSome OAuth love
Some OAuth love
 
Using OAuth with PHP
Using OAuth with PHPUsing OAuth with PHP
Using OAuth with PHP
 
OAuth 2.0 and Library
OAuth 2.0 and LibraryOAuth 2.0 and Library
OAuth 2.0 and Library
 
Api security
Api security Api security
Api security
 
Spring Social - Messaging Friends & Influencing People
Spring Social - Messaging Friends & Influencing PeopleSpring Social - Messaging Friends & Influencing People
Spring Social - Messaging Friends & Influencing People
 
How to get data from twitter (by hnnrrhm)
How to get data from twitter (by hnnrrhm)How to get data from twitter (by hnnrrhm)
How to get data from twitter (by hnnrrhm)
 
Oauth2 and OWSM OAuth2 support
Oauth2 and OWSM OAuth2 supportOauth2 and OWSM OAuth2 support
Oauth2 and OWSM OAuth2 support
 
An introduction to Laravel Passport
An introduction to Laravel PassportAn introduction to Laravel Passport
An introduction to Laravel Passport
 
Demystifying OAuth2 for PHP
Demystifying OAuth2 for PHPDemystifying OAuth2 for PHP
Demystifying OAuth2 for PHP
 
Oauth Php App
Oauth Php AppOauth Php App
Oauth Php App
 
Implementing OAuth with PHP
Implementing OAuth with PHPImplementing OAuth with PHP
Implementing OAuth with PHP
 
Mining Georeferenced Data
Mining Georeferenced DataMining Georeferenced Data
Mining Georeferenced Data
 
Webapp security (with notes)
Webapp security (with notes)Webapp security (with notes)
Webapp security (with notes)
 
Data Synchronization Patterns in Mobile Application Design
Data Synchronization Patterns in Mobile Application DesignData Synchronization Patterns in Mobile Application Design
Data Synchronization Patterns in Mobile Application Design
 
UC2013 Speed Geeking: Intro to OAuth2
UC2013 Speed Geeking: Intro to OAuth2UC2013 Speed Geeking: Intro to OAuth2
UC2013 Speed Geeking: Intro to OAuth2
 
APIdays Paris 2018 - Learning the OAuth Dance (Without Stepping on Anyone's T...
APIdays Paris 2018 - Learning the OAuth Dance (Without Stepping on Anyone's T...APIdays Paris 2018 - Learning the OAuth Dance (Without Stepping on Anyone's T...
APIdays Paris 2018 - Learning the OAuth Dance (Without Stepping on Anyone's T...
 
OAuth2 Best Practices in Native Apps
OAuth2 Best Practices in Native AppsOAuth2 Best Practices in Native Apps
OAuth2 Best Practices in Native Apps
 

Más de Susan Potter

Thinking in Properties
Thinking in PropertiesThinking in Properties
Thinking in PropertiesSusan Potter
 
Champaign-Urbana Javascript Meetup Talk (Jan 2020)
Champaign-Urbana Javascript Meetup Talk (Jan 2020)Champaign-Urbana Javascript Meetup Talk (Jan 2020)
Champaign-Urbana Javascript Meetup Talk (Jan 2020)Susan Potter
 
From Zero to Haskell: Lessons Learned
From Zero to Haskell: Lessons LearnedFrom Zero to Haskell: Lessons Learned
From Zero to Haskell: Lessons LearnedSusan Potter
 
Dynamically scaling a political news and activism hub (up to 5x the traffic i...
Dynamically scaling a political news and activism hub (up to 5x the traffic i...Dynamically scaling a political news and activism hub (up to 5x the traffic i...
Dynamically scaling a political news and activism hub (up to 5x the traffic i...Susan Potter
 
Functional Operations (Functional Programming at Comcast Labs Connect)
Functional Operations (Functional Programming at Comcast Labs Connect)Functional Operations (Functional Programming at Comcast Labs Connect)
Functional Operations (Functional Programming at Comcast Labs Connect)Susan Potter
 
From Zero to Application Delivery with NixOS
From Zero to Application Delivery with NixOSFrom Zero to Application Delivery with NixOS
From Zero to Application Delivery with NixOSSusan Potter
 
From Zero To Production (NixOS, Erlang) @ Erlang Factory SF 2016
From Zero To Production (NixOS, Erlang) @ Erlang Factory SF 2016From Zero To Production (NixOS, Erlang) @ Erlang Factory SF 2016
From Zero To Production (NixOS, Erlang) @ Erlang Factory SF 2016Susan Potter
 
Ricon/West 2013: Adventures with Riak Pipe
Ricon/West 2013: Adventures with Riak PipeRicon/West 2013: Adventures with Riak Pipe
Ricon/West 2013: Adventures with Riak PipeSusan Potter
 
Functional Algebra: Monoids Applied
Functional Algebra: Monoids AppliedFunctional Algebra: Monoids Applied
Functional Algebra: Monoids AppliedSusan Potter
 
Dynamo: Not Just For Datastores
Dynamo: Not Just For DatastoresDynamo: Not Just For Datastores
Dynamo: Not Just For DatastoresSusan Potter
 
Distributed Developer Workflows using Git
Distributed Developer Workflows using GitDistributed Developer Workflows using Git
Distributed Developer Workflows using GitSusan Potter
 
Link Walking with Riak
Link Walking with RiakLink Walking with Riak
Link Walking with RiakSusan Potter
 
Writing Bullet-Proof Javascript: By Using CoffeeScript
Writing Bullet-Proof Javascript: By Using CoffeeScriptWriting Bullet-Proof Javascript: By Using CoffeeScript
Writing Bullet-Proof Javascript: By Using CoffeeScriptSusan Potter
 
Designing for Concurrency
Designing for ConcurrencyDesigning for Concurrency
Designing for ConcurrencySusan Potter
 

Más de Susan Potter (15)

Thinking in Properties
Thinking in PropertiesThinking in Properties
Thinking in Properties
 
Champaign-Urbana Javascript Meetup Talk (Jan 2020)
Champaign-Urbana Javascript Meetup Talk (Jan 2020)Champaign-Urbana Javascript Meetup Talk (Jan 2020)
Champaign-Urbana Javascript Meetup Talk (Jan 2020)
 
From Zero to Haskell: Lessons Learned
From Zero to Haskell: Lessons LearnedFrom Zero to Haskell: Lessons Learned
From Zero to Haskell: Lessons Learned
 
Dynamically scaling a political news and activism hub (up to 5x the traffic i...
Dynamically scaling a political news and activism hub (up to 5x the traffic i...Dynamically scaling a political news and activism hub (up to 5x the traffic i...
Dynamically scaling a political news and activism hub (up to 5x the traffic i...
 
Functional Operations (Functional Programming at Comcast Labs Connect)
Functional Operations (Functional Programming at Comcast Labs Connect)Functional Operations (Functional Programming at Comcast Labs Connect)
Functional Operations (Functional Programming at Comcast Labs Connect)
 
From Zero to Application Delivery with NixOS
From Zero to Application Delivery with NixOSFrom Zero to Application Delivery with NixOS
From Zero to Application Delivery with NixOS
 
From Zero To Production (NixOS, Erlang) @ Erlang Factory SF 2016
From Zero To Production (NixOS, Erlang) @ Erlang Factory SF 2016From Zero To Production (NixOS, Erlang) @ Erlang Factory SF 2016
From Zero To Production (NixOS, Erlang) @ Erlang Factory SF 2016
 
Ricon/West 2013: Adventures with Riak Pipe
Ricon/West 2013: Adventures with Riak PipeRicon/West 2013: Adventures with Riak Pipe
Ricon/West 2013: Adventures with Riak Pipe
 
Functional Algebra: Monoids Applied
Functional Algebra: Monoids AppliedFunctional Algebra: Monoids Applied
Functional Algebra: Monoids Applied
 
Why Haskell
Why HaskellWhy Haskell
Why Haskell
 
Dynamo: Not Just For Datastores
Dynamo: Not Just For DatastoresDynamo: Not Just For Datastores
Dynamo: Not Just For Datastores
 
Distributed Developer Workflows using Git
Distributed Developer Workflows using GitDistributed Developer Workflows using Git
Distributed Developer Workflows using Git
 
Link Walking with Riak
Link Walking with RiakLink Walking with Riak
Link Walking with Riak
 
Writing Bullet-Proof Javascript: By Using CoffeeScript
Writing Bullet-Proof Javascript: By Using CoffeeScriptWriting Bullet-Proof Javascript: By Using CoffeeScript
Writing Bullet-Proof Javascript: By Using CoffeeScript
 
Designing for Concurrency
Designing for ConcurrencyDesigning for Concurrency
Designing for Concurrency
 

Último

NIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 WorkshopNIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 WorkshopBachir Benyammi
 
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration WorkflowsIgniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration WorkflowsSafe Software
 
UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8DianaGray10
 
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDEADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDELiveplex
 
Introduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxIntroduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxMatsuo Lab
 
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfJamie (Taka) Wang
 
Designing A Time bound resource download URL
Designing A Time bound resource download URLDesigning A Time bound resource download URL
Designing A Time bound resource download URLRuncy Oommen
 
9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding TeamAdam Moalla
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UbiTrack UK
 
AI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarAI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarPrecisely
 
Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Adtran
 
Empowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintEmpowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintMahmoud Rabie
 
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online CollaborationCOMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online Collaborationbruanjhuli
 
Nanopower In Semiconductor Industry.pdf
Nanopower  In Semiconductor Industry.pdfNanopower  In Semiconductor Industry.pdf
Nanopower In Semiconductor Industry.pdfPedro Manuel
 
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesAI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesMd Hossain Ali
 
Machine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfMachine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfAijun Zhang
 
Building AI-Driven Apps Using Semantic Kernel.pptx
Building AI-Driven Apps Using Semantic Kernel.pptxBuilding AI-Driven Apps Using Semantic Kernel.pptx
Building AI-Driven Apps Using Semantic Kernel.pptxUdaiappa Ramachandran
 
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...Aggregage
 
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationUsing IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationIES VE
 

Último (20)

20230104 - machine vision
20230104 - machine vision20230104 - machine vision
20230104 - machine vision
 
NIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 WorkshopNIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 Workshop
 
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration WorkflowsIgniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
 
UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8
 
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDEADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
 
Introduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxIntroduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptx
 
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
 
Designing A Time bound resource download URL
Designing A Time bound resource download URLDesigning A Time bound resource download URL
Designing A Time bound resource download URL
 
9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
 
AI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarAI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity Webinar
 
Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™
 
Empowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintEmpowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership Blueprint
 
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online CollaborationCOMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
 
Nanopower In Semiconductor Industry.pdf
Nanopower  In Semiconductor Industry.pdfNanopower  In Semiconductor Industry.pdf
Nanopower In Semiconductor Industry.pdf
 
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesAI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
 
Machine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfMachine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdf
 
Building AI-Driven Apps Using Semantic Kernel.pptx
Building AI-Driven Apps Using Semantic Kernel.pptxBuilding AI-Driven Apps Using Semantic Kernel.pptx
Building AI-Driven Apps Using Semantic Kernel.pptx
 
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
 
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationUsing IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
 

Twitter4R OAuth

  • 1. Configuring your Twitter4R App with OAuth Susan Potter (@SusanPotter) Twitter4R (@t4ruby) March 2011
  • 2. OAuth. . . • sucks to configure • but it is better than users passing 3rd party apps their clear passwords • 3rd party apps don’t need to store passwords that are decryptable
  • 3. OAuth. . . • sucks to configure • but it is better than users passing 3rd party apps their clear passwords • 3rd party apps don’t need to store passwords that are decryptable
  • 4. OAuth. . . • sucks to configure • but it is better than users passing 3rd party apps their clear passwords • 3rd party apps don’t need to store passwords that are decryptable
  • 5. In this screencast we will. . . • set up a new Twitter app https://twitter.com/apps/new • configure consumer tokens every app has a key and a secret; secret should be ’secret’ • getting access tokens for user apps need to retrieve access tokens for each user • use access tokens store access tokens (key and secret) for each user
  • 6. In this screencast we will. . . • set up a new Twitter app https://twitter.com/apps/new • configure consumer tokens every app has a key and a secret; secret should be ’secret’ • getting access tokens for user apps need to retrieve access tokens for each user • use access tokens store access tokens (key and secret) for each user
  • 7. In this screencast we will. . . • set up a new Twitter app https://twitter.com/apps/new • configure consumer tokens every app has a key and a secret; secret should be ’secret’ • getting access tokens for user apps need to retrieve access tokens for each user • use access tokens store access tokens (key and secret) for each user
  • 8. In this screencast we will. . . • set up a new Twitter app https://twitter.com/apps/new • configure consumer tokens every app has a key and a secret; secret should be ’secret’ • getting access tokens for user apps need to retrieve access tokens for each user • use access tokens store access tokens (key and secret) for each user
  • 9. Setting up a new Twitter app • Go to twitter.com • Login to your account • Fill in form at twitter.com/apps/new • Copy consumer tokens
  • 10. Setting up a new Twitter app • Go to twitter.com • Login to your account • Fill in form at twitter.com/apps/new • Copy consumer tokens
  • 11. Setting up a new Twitter app • Go to twitter.com • Login to your account • Fill in form at twitter.com/apps/new • Copy consumer tokens
  • 12. Setting up a new Twitter app • Go to twitter.com • Login to your account • Fill in form at twitter.com/apps/new • Copy consumer tokens
  • 13. Configuring consumer tokens # In a Rails 2.3 / 3.x app this might be # in: config/initializers/twitter4r.rb Twitter Client.configure do |config| config.oauth_consumer_token = CONSUMER_KEY config.oauth_consumer_secret = CONSUMER_SECRET end
  • 14. Configuring consumer tokens # In a Rails 2.3 / 3.x app this might be # in: config/initializers/twitter4r.rb Twitter Client.configure do |config| config.oauth_consumer_token = CONSUMER_KEY config.oauth_consumer_secret = CONSUMER_SECRET end
  • 15. Configuring consumer tokens # In a Rails 2.3 / 3.x app this might be # in: config/initializers/twitter4r.rb Twitter Client.configure do |config| config.oauth_consumer_token = CONSUMER_KEY config.oauth_consumer_secret = CONSUMER_SECRET end
  • 16. Configuring consumer tokens # In a Rails 2.3 / 3.x app this might be # in: config/initializers/twitter4r.rb Twitter Client.configure do |config| config.oauth_consumer_token = CONSUMER_KEY config.oauth_consumer_secret = CONSUMER_SECRET end
  • 17. Getting access tokens for a user, [1/2] # Using OAuth Ruby gem library helper in: # app/controller/application_controller.rb def redirect_to_twitter consumer = OAuth Consumer.new KEY, SECRET, :site => “https://twitter.com” token = consumer.get_request_token redirect_to(token.authorize_url) end
  • 18. Getting access tokens for a user, [1/2] # Using OAuth Ruby gem library helper in: # app/controller/application_controller.rb def redirect_to_twitter consumer = OAuth Consumer.new KEY, SECRET, :site => “https://twitter.com” token = consumer.get_request_token redirect_to(token.authorize_url) end
  • 19. Getting access tokens for a user, [1/2] # Using OAuth Ruby gem library helper in: # app/controller/application_controller.rb def redirect_to_twitter consumer = OAuth Consumer.new KEY, SECRET, :site => “https://twitter.com” token = consumer.get_request_token redirect_to(token.authorize_url) end
  • 20. Getting access tokens for a user, [1/2] # Using OAuth Ruby gem library helper in: # app/controller/application_controller.rb def redirect_to_twitter consumer = OAuth Consumer.new KEY, SECRET, :site => “https://twitter.com” token = consumer.get_request_token redirect_to(token.authorize_url) end
  • 21. Getting access tokens for a user, [2/2] # Using OAuth Ruby gem library in: # app/controller/oauth_controller.rb def create provider = params[:provider] case provider when ’twitter’ # bla bla bla end end # Remember to add the routes: match ’oauth/:provider/callback’ => ’oauth#create’
  • 22. Getting access tokens for a user, [2/2] # Using OAuth Ruby gem library in: # app/controller/oauth_controller.rb def create provider = params[:provider] case provider when ’twitter’ # bla bla bla end end # Remember to add the routes: match ’oauth/:provider/callback’ => ’oauth#create’
  • 23. Getting access tokens for a user, [2/2] # Using OAuth Ruby gem library in: # app/controller/oauth_controller.rb def create provider = params[:provider] case provider when ’twitter’ # bla bla bla end end # Remember to add the routes: match ’oauth/:provider/callback’ => ’oauth#create’
  • 24. Using access tokens # Pass in access key/secret tokens to # Twitter Client.new call for each user client = Twitter Client.new :oauth_access => { :key => ACCESS_KEY, :secret => ACCESS_SECRET } client.status(:post, “Tweet from my OAuth-ed app”)
  • 25. Using access tokens # Pass in access key/secret tokens to # Twitter Client.new call for each user client = Twitter Client.new :oauth_access => { :key => ACCESS_KEY, :secret => ACCESS_SECRET } client.status(:post, “Tweet from my OAuth-ed app”)
  • 26. Using access tokens # Pass in access key/secret tokens to # Twitter Client.new call for each user client = Twitter Client.new :oauth_access => { :key => ACCESS_KEY, :secret => ACCESS_SECRET } client.status(:post, “Tweet from my OAuth-ed app”)
  • 27. Fin HTH, if you have more questions: twitter4r-users@googlegroups.com
  • 28. Fin HTH, if you have more questions: twitter4r-users@googlegroups.com