WWW::Live::Auth - A Microsoft Live authentication client
1.0.0
Provides delegated authentication functionality for Microsoft Live services.
# Construct a client object my $client = WWW::Live::Auth->new( application_id => $appid, # string secret_key => $secret, # string or WWW::Live::Auth::SecretKey object client_ip => $ip # optional ); # Set the proxy (if necessary) $client->proxy( 'http://proxy.mycompany.com' ); # Obtain a URL to which a user may be directed in order to grant consent my $url = $client->consent_url( offers => 'ContactsSync.FullSync', # required privacy_url => 'http://mycompany.com/privacy_policy.html', # required return_url => 'http://mycompany.com/receive_consent.cgi', market => 'en-gb', context => '/interesting.html', ); # Parse an incoming consent notification my ( $token, $context ) = $client->receive_consent(); # Refresh a consent token if ( $token->expires < time() ) { $token = $client->refresh_consent( consent_token => $token ); }
Constructs a new authentication client for the application/client. my $client = WWW::Live::Auth->new( application_id => $appid, secret_key => $secret, client_ip => $ip, # optional ) The application ID and secret key are unique to your application. See L<http://msdn.microsoft.com/en-us/library/cc287659.aspx> for details.
Passes proxy settings through to LWP::UserAgent. Note the proxy must be capable of proxying HTTPS connections. $client->proxy( 'http://proxy.mycompany.com' );
Generates a URL to which a user can be directed in order to grant consent for the application to access one or more actions. my $url = $client->consent_url( offers => 'ContactsSync.FullSync', # required privacy_url => 'http://mycompany.com/privacy_policy.html', # required return_url => 'http://mycompany.com/receive_consent.cgi', market => 'en-gb', context => '/interesting.html', ); "Offers" is a comma separated list of actions offered by a resource provider. Once the user grants consent by visiting the URL, (s)he will be redirected to the return URL, along with a parameter indicating the application context.
Extracts the consent token and application context from an incoming HTTP request. An optional CGI object may be provided as the source of the data. If omitted, one will be created. my ( $token, $context ) = $client->receive_consent( $cgi );
Automatically refreshes an expired consent token. if ( $token->expires < time() ) { $token = $client->refresh_consent( consent_token => $token # required return_url => $url, # optional ); }
Generates a URL used for refreshing consent. my $url = $client->refresh_url( consent_token => $token, # required return_url => $url, # optional );
Andrew M. Jenkinson <jenkinson@cpan.org>
Copyright 2008-2011 Andrew M. Jenkinson.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
LWP::UserAgent CGI Crypt::Rijndael Digest::SHA MIME::Base64 Carp
WWW::Live::Contacts
LWP::UserAgent
API Errors<http://msdn.microsoft.com/en-us/library/cc287686.aspx>
To install WWW::Live::Auth, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WWW::Live::Auth
CPAN shell
perl -MCPAN -e shell install WWW::Live::Auth
For more information on module installation, please visit the detailed CPAN module installation guide.