[Bps-public-commit] jifty-plugin-authentication-twitter branch, master, updated. d45a40e20b577fc2758ac4aab5ee79966db3cd2d

Shawn Moore sartak at bestpractical.com
Fri Jun 4 08:55:43 EDT 2010


The branch, master has been updated
       via  d45a40e20b577fc2758ac4aab5ee79966db3cd2d (commit)
      from  9bcdbd77134f06f5cae6fb12b53ba2137aec3d43 (commit)

Summary of changes:
 .../Plugin/Authentication/Twitter/Dispatcher.pm    |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

- Log -----------------------------------------------------------------
commit d45a40e20b577fc2758ac4aab5ee79966db3cd2d
Author: Shawn M Moore <sartak at gmail.com>
Date:   Fri Jun 4 08:56:21 2010 -0400

    Begin working out the actual OAuth bits

diff --git a/lib/Jifty/Plugin/Authentication/Twitter/Dispatcher.pm b/lib/Jifty/Plugin/Authentication/Twitter/Dispatcher.pm
index f7c1c7e..d61333f 100644
--- a/lib/Jifty/Plugin/Authentication/Twitter/Dispatcher.pm
+++ b/lib/Jifty/Plugin/Authentication/Twitter/Dispatcher.pm
@@ -3,6 +3,7 @@ use warnings;
 
 package Jifty::Plugin::Authentication::Twitter::Dispatcher;
 use Jifty::Dispatcher -base;
+use Net::OAuth;
 
 =head1 NAME
 
@@ -31,5 +32,18 @@ before qr'^/twitter/callback' => run {
     }
 };
 
+on '/twitter/login' => run {
+    my ($plugin) = Jifty->find_plugin('Jifty::Plugin::Authentication::Twitter');
+    my $request_token_request = Net::OAuth->request("request token")->new(
+        consumer_key     => $plugin->consumer_key,
+        consumer_secret  => $plugin->consumer_secret,
+        request_url      => 'http://twitter.com/oauth/request_token',
+        request_method   => 'POST',
+        signature_method => 'HMAC-SHA1',
+        timestamp        => time,
+        nonce            => $$ * rand,
+    );
+};
+
 1;
 

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list