Can't login with openID - Email is required ?
I'm trying to log-in with your openID addon, to my forums board running on Vanilla 2.0.18.4 (fresh install...)
I've enabled openID plugin (and then settings, of course), log-in with myopenid.com but when it ask my mail address and an username, so there is the following error message "Email is required."
Is it necessary the same mail address used to register with myopenid.com ?
May be my server's php config is not right to work with this addon but I did tried on 2 servers and it's failed... do you know more about it ?
all "idea" would be welcomed many thanks in advance
Related post (LiveJournal) : http://vanillaforums.org/discussion/16419/
Best Answer
-
businessdad MVP
I stumbled upon the same issue and I fixed it by changing OpenID plugin. Here's how to fix it.
File: class.openid.plugin.php.
Original code
$Form->SetFormValue('FullName', GetValue('namePerson/first', $Attr).' '.GetValue('namePerson/last', $Attr)); $Form->SetFormValue('Email', GetValue('contact/email', $Attr));
Change it to
if($Form->GetValue('FullName', null) == null) { $Form->SetFormValue('FullName', GetValue('namePerson/first', $Attr).' '.GetValue('namePerson/last', $Attr)); } if($Form->GetValue('Email', null) == null) { $Form->SetFormValue('Email', GetValue('contact/email', $Attr)); }
Explanation
OpenID plugin handles ConnectData event and tries to add to it User Information received by OpenID provider. In original code, the values found in the Login form for FullName and Email are overwritten by OpenID data. However, this data may be null, in which case User is asked to provide it.When User fills the fields and clicks on Connect, ConnectData event is fired again. The event handlers runs one more time and, again, overwrites the above fields with null, causing the "Email is required" error.
I can't guarantee that my fix is the right way of doing things, therefore I think this issue should be reviewed by the Core Team.
5
Answers
I stumbled upon the same issue and I fixed it by changing OpenID plugin. Here's how to fix it.
File: class.openid.plugin.php.
Original code
Change it to
Explanation
OpenID plugin handles ConnectData event and tries to add to it User Information received by OpenID provider. In original code, the values found in the Login form for FullName and Email are overwritten by OpenID data. However, this data may be null, in which case User is asked to provide it.
When User fills the fields and clicks on Connect, ConnectData event is fired again. The event handlers runs one more time and, again, overwrites the above fields with null, causing the "Email is required" error.
I can't guarantee that my fix is the right way of doing things, therefore I think this issue should be reviewed by the Core Team.
My shop | About Me
Sorry, I'm late, but many thanks @businessdad for these explanations and related code
I 'll try it as soon as possible, 'll give feedback to you
Worked like a charm businessdad! Thank you...saved me a little time.