views:

90

answers:

1

Hi! I'm having problems with a small OpenID-library called LightOpenID . I can authenticate to almost all providers, but I don't know how to fetch the data from the provider. I only get Array(), eaven with print_r().

+3  A: 

You need to call getAttributes() after $openid->validate() not before.

Remember:

Note that it does not guarantee that any of the required/optional parameters will be present

Pete
I've done like this now: http://pastebin.com/ULsLvhxpSo to display the email, do I use $foo['email']?
Grozzy
It'll be `$foo['contact/email']` - as per the docs, the attributes are mapped to the AX format.
Pete
Also, `$openid->required = array('contact/email');` needs to be called **before** `$openid->validate()`
Pete
http://pastebin.com/Xrhh7Ukb - Still not working, I'm pretty sure it should show some nickname or email.
Grozzy
You've got `$openid->validate();` twice. Also, as mentioned, there's no guarantee that the OP or user exchanges the information.
Pete
http://pastebin.com/wV1jv0jF http://pastebin.com/YcQv2Hvf
Pete
AH, well thank you! :)
Grozzy