| Issue 10: | not valid with yandex & optional | |
| 1 person starred this issue and may be notified of changes. | Back to list |
my class
class Ncw_OpenID extends LightOpenID
{
const OPENID_MODE_CANCEL = 'cancel';
/**
* @todo Не работает авторизация с параметрами
*/
public function __construct()
{
parent::__construct();
$this->required = array('namePerson/friendly', 'contact/email');
$this->optional = array('contact/email');
}
public function getAttributes() {
$attr = parent::getAttributes();
$newAttr = array();
foreach ($attr as $key => $value) {
if (isset(parent::$ax_to_sreg[$key])) $key = parent::$ax_to_sreg[$key];
$newAttr[$key] = $value;
}
return $newAttr;
}
}
$openid->validate() return false, if i comment
//$this->required = array('namePerson/friendly', 'contact/email');
//$this->optional = array('contact/email');
openid work...
Oct 14, 2010
Project Member
#1
mewp...@gmail.com
Oct 15, 2010
http://guildland.ru/openid/example.php i use your example. yandex returns nickname & email, but the validation returns false
Oct 15, 2010
User has not logged in.array(2) { ["contact/email"]=> string(18) "xxxxx" ["namePerson/friendly"]=> string(7) "ErgallM" }
Oct 15, 2010
Well, the validation could return false even if attributes are returned. Unfortunately, I can't easily register or test authentication with yandex.ru, since I don't know russian at all. Could you verify that the other consumers don't have the problem (like stackoverflow.com, for example)? If it is indeed a problem related to LightOpenID, could you please guide me through authentication with yandex.ru (with some test login), so that I can test it myself?
Oct 17, 2010
i reg. test user. login: cool.test-2011[dog]yandex.ru, p: test_2010
Oct 18, 2010
I can not reproduce the error. I've copied and pasted your example, and it works fine for me, using the latest version from gitorious. However, it seems that v0.2 that you're able to download from here doesn't work indeed. My advice is: upgrade. I've posted lightopenid-0.3 for download here, it should work for you. Please confirm that everything is fine, so I can close the bug. By the way: 1. Don't specify contact/email both in required and optional -- it's treated just like required. 2. Don't specify required and optional before validation -- it's not necessary. Those are needed only to tell the OP that we want the attributes. Later, when it has already resopnded, LightOpenID returns all avaiable attributes regardless of whether they are required/optional or not.
Oct 18, 2010
i can't open new version, archive error: gzip: stdin: not in gzip format tar: Child returned status 1 tar: Exiting with failure status due to previous errors
Oct 19, 2010
No idea why. Try to download again, I've reuploaded it.
Oct 19, 2010
unpacked by 7za) v0.3 works with yandex) thanks)
Oct 19, 2010
Good to know.
Status:
Done
|