Net::OAuth::Easy - A moose class that abstracts Net::OAuth for you
version 0.001_05
A LWP::UserAgent object to do the message passing.
What OAuth protocol do you wish your messages to be build in?
'1.0a' Default
'1.0'
Defines the method of the request.
'GET' Default
'POST'
Defines the method to sign the request.
'HMAC-SHA1' Default
'RSA-SHA1'
Where to find the signature key, only used for RSA-SHA1 type signatures.
Expected to be passed a Crypt::OpenSSL::RSA object. Though if passed a string, this will be assumped to be a filename and will be passed to the new_private_key method of Crypt::OpenSSL::RSA.
This is a HashRef of ArrayRefs that is used to define the required elements of each type of OAuth request. The type (ie request_token) is the key and all items in the ArrayRef value will be collected from $self if not passed at the time that the request is built.
Stores a coderef that is called when an exception is hit. Out of the box this does not do anything more then die with a message, though it can be used to leverage diffrent codepaths at the time of an exception.
It is used internaly as such:
$self->exception_handle->(q{unable to sign request});
Thus if you need to define your own you will have $self and a note about why it was called.
I'm not completely happy with this so it could change but this should get any one needing this the most basic items currently.
Stores the response when any of the get_* methods are called.
If defined it is expected to be a string(URL) that will be included in to the Authorization headers. If not given it will be ignored.
A string that denotes the string that you would like to use to seperate the key=value pairs in the Authuntication header.
Defaults to ','.
Stores the request_token when it's collected via get_request_token.
Stores the request_token_secret when it's collected via get_request_token.
Stores the access_token when it's collected via get_request_token.
Stores the access_token_secret when it's collected via get_request_token.
Currently just an alias to time, it is used to define the timestamp of the OAuth request.
Define a unique id for every OAuth request, curently this is done by taking the md5_hex of two random numbers and the time.
Used to build the Net::OAuth request object based on input and gather_request_parts.
Uses request_parameters to merge passed items with stored values to complete all items required for build_request.
Shortcut to get the content of the response, will return undef if in the case of no response yet stored.
Shortcut to see if a successful response was collected, returns 0 in the case of no response yet stored.
Returns the inverse of success.
In the case of a non-successful response, will return a formated string that includes the status_line and content to describe the reason for failure. Will return undef in the case of no response yet stored.
Given a Net::OAuth request, convert it to a HTTP::Request such that it can be sent via ua. One other thing to note is that make_request also calls clear_request thus destroying any previously stored request.
Add the Authentication header to the HTTP request based on the OAuth request if the request method is POST.
Pass the given HTTP::Request object to ua thus sending out the request to the world.
Builds up an OAuth request to get the request_token pairs.
Build out the URL that is needed to be called to collect the oauth_verifier.
Unpack the return url from the OAuth provider that includes items like oauth_verifier. Returns a hash of unparsed items.
Collect and store the access_tokens.
Ben Hengst <notbenh@cpan.org>
This software is copyright (c) 2010 by Ben Hengst.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
1 POD Error
The following errors were encountered while parsing the POD:
Unknown directive: =roles
To install Net::OAuth::Easy, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::OAuth::Easy
CPAN shell
perl -MCPAN -e shell install Net::OAuth::Easy
For more information on module installation, please visit the detailed CPAN module installation guide.