5 vjlogin - authenticate openid users
9 http://your.server.com/cgi-bin/vjlogin/your-blog-top
13 Authenticates user with external OpenID provider, creates VJournal
14 session and sets approprieate cookie.
24 =item Parameters username and site
28 =item OpenID parameters
30 Perform authentication. If successul, create session.
31 If E-mail is provided, redirect back to blog. Otherwise - show form
32 to requset E-Mail. Create session anyway.
34 =item email parameter + cookie
36 Update session. Redirect to blog.
43 use Net::OpenID::Consumer;
44 use VJournal::Session;
47 my ($cgi,$consumer)=@_;
48 if (my $setup_url = $csr->user_setup_url) {
49 print $cgi->redirect(-location=>$setup_url);
51 } elsif ($csr->user_cancel) {
52 show_error("OpenID server cancelled operation");
53 } elsif (my $vident= $csr->verified_identity) {
54 my $user = $vident->url();
55 # Getting OPENDID extensions from
56 my @extension =grep { defined } (
57 $vident->signed_extension_fields('http://openid.net/extensions/sreg/1.1'),
58 $vident->signed_extension_fields('http://openid.net/srv/ax/1.0'),
63 my $foaf = $vident->declared_foaf();
64 my ($email,$avatar) = ($foaf?get_foaf($foaf):(undef,undef));
65 my $session = VJournal::Session->create(-cgi=>$cgi,
66 -name => $name, -idenity=>$user);