$vident->signed_extension_fields('http://openid.net/srv/ax/1.0'),
);
}
+ my $nickname;
foreach my $ext (@extensions) {
foreach my $field (qw{value.email email}) {
if (exists $ext->{$field} &&
defined $ext->{$field} &&
length $ext->{$field}) {
$session->param(email => $ext->{$field});
+ if (! defined $nickname &&
+ $ext->{$field}=~/(.+)@.+/) {
+ $nickname = $1;
+ }
last;
}
}
if (exists $ext->{$field} &&
defined $ext->{$field} &&
length $ext->{$field}) {
- $session->param(username => $ext->{$field});
+ $nickname=$ext->{$field};
last;
}
}
}
+ if (defined $nickname) {
+ $session->param(nickname =>
+ Encode::decode_utf8($nickname));
+ }
}
else {
error("OpenID failure: ".$csr->err);