use strict;
use warnings;
use Net::OpenID::Consumer;
use LWPx::ParanoidAgent;
my $csr = Net::OpenID::Consumer->new(
ua => LWPx::ParanoidAgent->new,
consumer_secret => 'foo',
required_root => "http://localhost:3000",
);
my $claimed_identity = $csr->claimed_identity("http://localhost:3000") || die $csr->err;
my $check_url = $claimed_identity->check_url(
return_to => "http://localhost:3000/openid-check.app?yourarg=val",
trust_root => "http://localhost:3000/",
);
$csr->handle_server_response(
not_openid => sub {
die "Not an OpenID message";
},
setup_required => sub {
my $setup_url = shift;
print "setup_required $setup_url\n";
},
cancelled => sub {
print "cancelled\n";
},
verified => sub {
my $vident = shift;
print "verified $vident\n";
},
error => sub {
my $err = shift;
die($err);
},
);