Class: OmniAuth::Strategies::Surveymonkey2
- Inherits:
-
OAuth2
- Object
- OAuth2
- OmniAuth::Strategies::Surveymonkey2
- Defined in:
- lib/omniauth/strategies/surverymonkey2.rb
Constant Summary collapse
- DEFAULT_RESPONSE_TYPE =
'code'- DEFAULT_GRANT =
'authorization_code'
Instance Method Summary collapse
- #authorize_params ⇒ Object
- #build_access_token ⇒ Object
- #callback_phase ⇒ Object
- #token_params ⇒ Object
Instance Method Details
#authorize_params ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'lib/omniauth/strategies/surverymonkey2.rb', line 20 def log :info, ">>>>>>>> in authorize_params" super.tap do |params| params[:response_type] ||= DEFAULT_RESPONSE_TYPE params[:client_id] = [:client_id] params[:api_key] = [:api_key] end end |
#build_access_token ⇒ Object
39 40 41 42 43 44 45 46 47 |
# File 'lib/omniauth/strategies/surverymonkey2.rb', line 39 def build_access_token log :info, ">>>>>>>> calling build_access_token" verifier = request.params['code'] log :info, ">>>>>>> code: #{verifier.inspect}" log :info, ">>>>> getting auth token now" token = client.auth_code.get_token(verifier, token_params) log :info, ">>>>>> token: #{token.inspect}" token end |
#callback_phase ⇒ Object
49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/omniauth/strategies/surverymonkey2.rb', line 49 def callback_phase log :info, ">>>>>>>> in callback_phase" [:client_options][:token_url] = "/oauth/token?api_key=#{options[:api_key]}" log :info, ">>>> in callback phase, calling build_access_token" self.access_token = build_access_token log :info, ">>>>>> self access token: #{self.access_token.inspect}" log :info, ">>>> getting ready to set auth hash" hash = auth_hash log :info, ">>>>> auth hash is: #{hash.inspect}" self.env['omniauth.auth'] = hash log :info, ">>>> calling app" call_app! end |
#token_params ⇒ Object
29 30 31 32 33 34 35 36 37 |
# File 'lib/omniauth/strategies/surverymonkey2.rb', line 29 def token_params log :info, ">>>>>>> calling token params" super.tap do |params| params[:grant_type] ||= DEFAULT_GRANT params[:client_id] = [:client_id] params[:client_secret] = [:client_secret] params[:redirect_uri] = callback_url end end |