Bonus question: Anybody knows how to do it using ruby-openid gem?
Thanks!
Bonus question: Anybody knows how to do it using ruby-openid gem?
Thanks!
No, I don't think so.
And any attempts to do so (without the user's permission) would certainly be considered malicious and unethical.
If you're open to an outsourced solution have a look at http://www.janrain.com/products/engage
It is possible with both, but with some limitations. OpenID provider needs to support either simple registration or attribute exchange. For example Yahoo supports sreg and Google supports AX. Yahoo will send email only to verified websites. Google asks for user's premission before sharing email with openid relying party, if user declines login will fail.
To get user's email from Facebook your application should first ask for extended permissions (see http://developers.facebook.com/docs/authentication/permissions and http://developers.facebook.com/blog/post/355).
This is pretty common question, so you should be able to google up ton of info on this subject.