Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Net::OAuth v0.16 released - OAuth 1.0a support
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  1 message - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Keith Grennan  
View profile  
 More options Jun 15, 3:00 pm
From: Keith Grennan <keith.gren...@gmail.com>
Date: Mon, 15 Jun 2009 12:00:55 -0700 (PDT)
Local: Mon, Jun 15 2009 3:00 pm
Subject: Net::OAuth v0.16 released - OAuth 1.0a support
Changelog:

* Added support for OAuth 1.0A - see POD section 'OAUTH 1.0A' for
details - Net::OAuth still defaults to 1.0 for now

Added the following POD regarding OAuth 1.0a spec support.

Best,
Keith

OAUTH 1.0A

Background:

http://mojodna.net/2009/05/20/an-idiots-guide-to-oauth-10a.html

http://oauth.googlecode.com/svn/spec/core/1.0a/drafts/3/oauth-core-1_...

Net::OAuth defaults to OAuth 1.0 spec compliance, and supports OAuth
1.0 Rev A with an optional switch:

 use Net::OAuth
 $Net::OAuth::PROTOCOL_VERSION = Net::OAuth::PROTOCOL_VERSION_1_0A;

It is recommended that any new projects use this switch if possible,
and existing projects move to supporting this switch as soon as
possible. Probably the easiest way for existing projects to do this is
to turn on the switch and run your test suite. The Net::OAuth
constructor will throw an exception where the new protocol parameters
(callback, callback_confirmed, verifier) are missing.

Internally, the Net::OAuth::Message constructor checks
$Net::OAuth::PROTOCOL_VERSION and attempts to load the equivalent
subclass in the Net::OAuth::V1_0A:: namespace. So if you instantiate a
Net::OAuth::RequestTokenRequest object, you will end up with a
Net::OAuth::V1_0A::RequestTokenRequest (a subclass of
Net::OAuth::RequestTokenRequest) if the protocol version is set to
PROTOCOL_VERSION_1_0A. You can also select a 1.0a subclass on a per-
message basis by passing

    protocol_version => Net::OAuth::PROTOCOL_VERSION_1_0A

in the API parameters hash.

If you are not sure whether the entity you are communicating with is
1.0A compliant, you can try instantiating a 1.0A message first and
then fall back to 1.0 if that fails:

    use Net::OAuth
    $Net::OAuth::PROTOCOL_VERSION = Net::OAuth::PROTOCOL_VERSION_1_0A;
    my $is_oauth_1_0 = 0;
    my $response = eval{Net::OAuth->response('request token')-

>from_post_body($res->content)};

    if ($@) {
        if ($@ =~ /Missing required parameter 'callback_confirmed'/) {
            # fall back to OAuth 1.0
            $response = Net::OAuth->response('request token')-
>from_post_body(

                $res->content,
                protocol_version => Net::OAuth::PROTOCOL_VERSION_1_0
            );
            $is_oauth_1_0 = 1; # from now on treat the server as OAuth
1.0 compliant
        }
        else {
            die $@;
        }
    }
At some point in the future, Net::OAuth will default to
Net::OAuth::PROTOCOL_VERSION_1_0A.

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google