I wrote a Dancer web application that uses Net::OpenID::Consumerto use OpenID for authentication. It works well with Google and MyOpenID, but not with Yahoo. When a user tries to authenticate his Yahoo account, he HTML::Parserwarns:
Parsing of undecoded UTF-8 will give garbage when decoding entities
and this warning kills my application (rightfully).
I do not see any existing errors with Net::OpenID::Consumer(or Common) that relate to this.
The HTTP headers and HTML meta tags indicate UTF-8 for the URI of the declared identifier.
Why the answer will not be decoded for HTML::Parser? Am I missing something?
Here is the relevant code:
get '/openid_landing' => sub {
my $params = params();
my $csr = Net::OpenID::Consumer->new(
ua => LWP::UserAgent->new(),
consumer_secret => $secret,
params => $params,
);
my $id = $params->{'openid.claimed_id'};
if (my $setup_url = $csr->user_setup_url) {
redirect $setup_url;
} elsif ($csr->user_cancel) {
redirect uri_for('/');
} elsif (my $vident = $csr->verified_identity) {
...
} else {
die "Error validating identity: " . $csr->err;
}
};
source
share