2

次の出力から個々の値を取得する方法が必要です。

@auth_hash = request.env['omniauth.auth']
 <p><%= @auth_hash.inspect %></p>// i got following out from this line of code '

たとえば、名前、アカウント、ユーザーが必要です。どうすれば入手できますか?

#<OmniAuth::AuthHash
 credentials=#<Hashie::Mash expires=true expires_at=12233 token="wwewewewqeqweqweqwewqewqewqewqewewqewqewewqewqewqewqeqwewqewqewqqxcfdvfgfghfhgfhgfhgfhgghfhggfhgfhgfhgfhgh">
 extra=#<Hashie::Mash raw_info=#<Hashie::Mash
 education=[#<Hashie::Mash school=#<Hashie::Mash id="131103480269939"
  name="zxsd sdsr"> type="High School">, #<Hashie::Mash school=
  #<Hashie::Mash id="107936305917315" name="GHSS BANGRA yyyyy">
  type="High School" year=#<Hashie::Mash id="113125125403208" name="2004">>,
  #<Hashie::Mash school=#<Hashie::Mash id="198825526799921" name="vhse kunjathur">
  type="High School" year=#<Hashie::Mash id="113125125403208" name="2004">>]
 email="xxxxxx@yahoo.co.in" first_name="zxxxxxxxx" gender="male"
 hometown=#<Hashie::Mash id="107013659338585" name="yyyyyyy, Kerala, India">
 id="502830644" last_name="xxxxx" link="http://www.facebook.com/xxxxxx"
 locale="en_US" location=#<Hashie::Mash id="106216379410251" name="Mangalore">
 name="xxxxxxxxxxxx" timezone=5.5 updated_time="2012-04-01T05:08:36+0000"
 username="xxxxxx" verified=true>> info=#<OmniAuth::AuthHash::InfoHash
 email="xxxxxx@yahoo.co.in" first_name="xxxxxxx"
 image="http://graph.facebook.com/502830644/picture?type=square"
 last_name="xxxxxxx" location="Mangalore" name="xxxxxxxx xxxxxxx"
 nickname="xxxxxx" urls=#<Hashie::Mash Facebook="http://www.facebook.com/xxxxx">
 verified=true> provider="facebook" uid="566767666">
4

1 に答える 1

1

https://github.com/mkdynamic/omniauth-facebook#auth-hashを確認する必要があります

request.env['omniauth.auth'][:info][:name]
于 2012-09-01T05:48:37.153 に答える