NAME
WebService::Windows::LiveID::Auth - Perl implementation of Windows Live ID Web Authentication 1.0
VERSION
version 0.01
SYNOPSIS
my
$appid
=
'00163FFF80003203'
;
my
$secret_key
=
'ApplicationKey123'
;
my
$appctx
=
'zigorou'
;
my
$auth
= WebService::Windows::LiveID::Auth->new({
appid
=>
$appid
,
secret_key
=>
$secret_key
});
local
$\ =
"\n"
;
$auth
->control_url;
### SignIn, SignOut links page by LiveID. Set this page url to iframe's src attribute.
$auth
->sign_in_url;
### SignIn page
$auth
->sign_out_url;
### SignOut page
In the request to "ReturnURL",
use
CGI;
my
$q
= CGI->new;
my
$appid
=
'00163FFF80003203'
;
my
$secret_key
=
'ApplicationKey123'
;
my
$appctx
=
'zigorou'
;
my
$auth
= WebService::Windows::LiveID::Auth->new({
appid
=>
$appid
,
secret_key
=>
$secret_key
});
my
$user
=
eval
{
$auth
->process_token(
$q
->param(
"stoken"
),
$appctx
); };
$q
->header;
unless
($@) {
"<p>Login sucsess.</p>\n"
;
"<p>uid: "
.
$user
->uid .
"</p>"
;
}
else
{
"<p>Login failed.</p>"
;
}
METHODS
new($arguments)
Constructor. $arguments must be HASH reference.
## Constructor parameter sample.
$arguments
= {
appid
=>
'00163FFF80003203'
,
## required
secret_key
=>
'ApplicationKey123'
,
## required
algorithm
=>
'wsignin1.0'
## optional
};
process_token($stoken, $appctx)
Process and validate stoken value. If the authentication is sucsess, then this method will return WebService::Windows::LiveID::Auth::User object. On fail, return undef value.
control_url([$query])
Return control url as URI::http object. $query parameter is optional, It must be HASH reference.
## query parameter sample
$query
= {
appctx
=>
"zigorou"
,
style
=>
"font-family: Times Roman;"
};
Or
$query
= {
appctx
=>
"zigorou"
,
style
=> {
"font-family"
=>
"Verdana"
,
"color"
=>
"Grey"
}
}
The "style" property allows SCALAR and HASH reference.
sign_in_url([$query])
Return sign-in url as URI::http object. $query parameter is optional, It must be HASH reference.
## query parameter sample
$query
= {
appctx
=>
"zigorou"
};
sign_out_url()
Return sign-out url as URI::http object.
appid([$appid])
Application ID
algorithm([$algorithm])
Algorithm name
secret_key([$secret_key])
Secret key
sign_key()
Signature key.
crypt_key()
Encryption key
SEE ALSO
- http://go.microsoft.com/fwlink/?linkid=92886
- http://msdn2.microsoft.com/en-us/library/bb676626.aspx
- http://dev.live.com/blogs/liveid/archive/2006/05/18/8.aspx
- http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=646&SiteID=1
- http://www.microsoft.com/downloads/details.aspx?FamilyId=8BA187E5-3630-437D-AFDF-59AB699A483D&displaylang=en
- http://msdn2.microsoft.com/en-us/library/bb288408.aspx
- Crypt::Rijndael
- Digest::SHA
- MIME::Base64
- URI::Escape
AUTHOR
Toru Yamaguchi, <zigorou@cpan.org>
BUGS
Please report any bugs or feature requests to bug-webservice-windows-liveid-auth@rt.cpan.org
, or through the web interface at http://rt.cpan.org. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
COPYRIGHT & LICENSE
Copyright 2007 Toru Yamaguchi, All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.