class OmniAuth::Strategies::Youku

Public Instance Methods

authorize_params() click to toggle source

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.

Calls superclass method
# File lib/omniauth/strategies/youku.rb, line 47
def authorize_params
  super.tap do |params|
    %w[ state ].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() click to toggle source
# File lib/omniauth/strategies/youku.rb, line 37
def raw_info
  access_token.options[:mode] = :query
  @raw_info ||= access_token.get('/v2/users/myinfo.json', params: signed_params).parsed
end

Private Instance Methods

signed_params() click to toggle source
# File lib/omniauth/strategies/youku.rb, line 62
def signed_params
  {
    client_id: client.id,
    access_token: access_token.token
  }
end