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

Shawn Moore sartak at bestpractical.com
Fri Jun 4 09:11:56 EDT 2010


The branch, master has been updated
       via  5c90d1e569ee649a699fc45564eda4b7e6092dd4 (commit)
      from  9ea31f103f68dee623c25fe65b05f06324491d9e (commit)

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

- Log -----------------------------------------------------------------
commit 5c90d1e569ee649a699fc45564eda4b7e6092dd4
Author: Shawn M Moore <sartak at gmail.com>
Date:   Fri Jun 4 09:12:40 2010 -0400

    Post the request token request to twitter

diff --git a/lib/Jifty/Plugin/Authentication/Twitter/Dispatcher.pm b/lib/Jifty/Plugin/Authentication/Twitter/Dispatcher.pm
index 2e348cb..b4d4d0a 100644
--- a/lib/Jifty/Plugin/Authentication/Twitter/Dispatcher.pm
+++ b/lib/Jifty/Plugin/Authentication/Twitter/Dispatcher.pm
@@ -4,6 +4,7 @@ use warnings;
 package Jifty::Plugin::Authentication::Twitter::Dispatcher;
 use Jifty::Dispatcher -base;
 use Net::OAuth;
+use HTTP::Request::Common ();
 
 =head1 NAME
 
@@ -43,6 +44,18 @@ on '/twitter/login' => run {
         timestamp        => time,
         nonce            => $$ * rand,
     );
+    $request_token_request->sign;
+
+    my $ua = LWP::UserAgent->new;
+
+    my $res = $ua->request(HTTP::Request::Common::POST $request_token_request->to_url);
+    if (!$res->is_success) {
+        die "Something went wrong";
+    }
+
+    my $response = Net::OAuth->response('request token')->from_post_body($res->content);
+    # $response->token;
+    # $response->token_secret;
 };
 
 1;

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



More information about the Bps-public-commit mailing list