Class: OmniAuth::Strategies::QQConnect
- Inherits:
-
OAuth2
- Object
- OAuth2
- OmniAuth::Strategies::QQConnect
- Defined in:
- lib/omniauth/strategies/qq_connect.rb
Instance Method Summary collapse
Instance Method Details
#raw_info ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/omniauth/strategies/qq_connect.rb', line 27 def raw_info @raw_info ||= begin access_token.[:mode] = :query access_token.[:param_name] = :access_token # Response Example: "callback( {\"client_id\":\"11111\",\"openid\":\"000000FFFF\"} );\n" response = access_token.get('/oauth2.0/me') #TODO handle error case matched = response.body.match(/"openid":"(?<openid>\w+)"/) matched[:openid] end end |
#user_info ⇒ Object
39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/omniauth/strategies/qq_connect.rb', line 39 def user_info @user_info ||= begin #TODO handle error case #TODO make info request url configurable client.request(:get, "https://graph.qq.com/user/get_user_info", :params => { :format => :json, :openid => uid, :oauth_consumer_key => [:client_id], :access_token => access_token.token }, :parse => :json).parsed end end |