views:

248

answers:

0

Im currently using ruby-openid gem to work with OpenID providers within my Sinatra application, but i cannot get information fields.

This is an example request:

openid_url = 'blahblah'
resp = openid.begin(openid_url)
resp.add_extension_arg('sreg','required','email')
resp.add_extension_arg('sreg','optional','fullname,nickname,dob,gender')
redirect_url = response.redirect_url('http://localhost:4567', 'http://localhost:4567/complete')
redirect redirect_url

Parse result fields:

info = response.extension_response('sreg',true)

I can login with most providers like Google, Yahoo, myOpenId, ... But the problem: i cant get the email information from all of them. Also, i cant get any information from Google`s openid.

So, how to solve this? Am i doing something wrong ?