Class: OmniAuth::Strategies::Weibo
- Inherits:
-
OAuth2
- Object
- OAuth2
- OmniAuth::Strategies::Weibo
- Defined in:
- lib/omniauth/strategies/weibo.rb
Instance Method Summary collapse
-
#authorize_params ⇒ Object
You can pass
display,with_offical_accountorstateparams to the auth request, if you need to set them dynamically. - #raw_info ⇒ Object
Instance Method Details
#authorize_params ⇒ Object
You can pass display, with_offical_account or state params to the auth request, if you need to set them dynamically. You can also set these options in the OmniAuth config :authorize_params option.
/auth/weibo?display=mobile&with_offical_account=1
53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/omniauth/strategies/weibo.rb', line 53 def super.tap do |params| %w[display with_offical_account state forcelogin].each do |v| if request.params[v] params[v.to_sym] = request.params[v] # to support omniauth-oauth2's auto csrf protection session['omniauth.state'] = params[:state] if v == 'state' end end end end |
#raw_info ⇒ Object
39 40 41 42 43 44 |
# File 'lib/omniauth/strategies/weibo.rb', line 39 def raw_info access_token.[:mode] = :query access_token.[:param_name] = 'access_token' @uid ||= access_token.get('/2/account/get_uid.json').parsed["uid"] @raw_info ||= access_token.get("/2/users/show.json", :params => {:uid => @uid}).parsed end |