class OmniAuth::Strategies::Clever

Public Instance Methods

callback_phase() click to toggle source
Calls superclass method
# File lib/omniauth/strategies/clever.rb, line 29
def callback_phase
  error = request.params["error_reason"] || request.params["error"]
  stored_state = session.delete("omniauth.state")
  if error
    fail!(error, CallbackError.new(request.params["error"], request.params["error_description"] || request.params["error_reason"], request.params["error_uri"]))
  else
    # Only verify state if we've initiated login and have stored a state
    # to compare to.
    if stored_state && (!request.params["state"] || request.params["state"] != stored_state)
      fail!(:csrf_detected, CallbackError.new(:csrf_detected, "CSRF detected"))
    else
      super
    end
  end
end
callback_url() click to toggle source

Fix unknown redirect uri bug by NOT appending the query string to the callback url.

# File lib/omniauth/strategies/clever.rb, line 62
def callback_url
  full_host + script_name + callback_path
end
raw_info() click to toggle source
# File lib/omniauth/strategies/clever.rb, line 57
def raw_info
  @raw_info ||= access_token.get('/me').parsed
end
token_params() click to toggle source
Calls superclass method
# File lib/omniauth/strategies/clever.rb, line 23
def token_params
  super.tap do |params|
    params[:headers] = {'Authorization' => "Basic #{Base64.strict_encode64("#{options.client_id}:#{options.client_secret}")}"}
  end
end