class OmniAuth::Strategies::Chatwork

Constants

DEFAULT_SCOPE

Public Instance Methods

access_token_callback_url() click to toggle source
# File lib/omniauth/strategies/chatwork.rb, line 63
def access_token_callback_url
  # Remove query string from OmniAuth::Strategy#callback_url
  # https://github.com/omniauth/omniauth/blob/v1.7.1/lib/omniauth/strategy.rb#L438-L440
  options[:callback_url] || (full_host + script_name + callback_path)
end
authorize_params() click to toggle source

You can pass scope 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.

For example: /auth/chatwork?scope=rooms.all:read_write

Calls superclass method
# File lib/omniauth/strategies/chatwork.rb, line 45
def authorize_params
  super.tap do |params|
    %w[scope].each do |v|
      if request.params[v]
        params[v.to_sym] = request.params[v]
      end
    end

    params[:scope] ||= DEFAULT_SCOPE
    params[:scope] = Array(params[:scope]).join(" ")
  end
end
build_access_token() click to toggle source
# File lib/omniauth/strategies/chatwork.rb, line 58
def build_access_token
  verifier = request.params["code"]
  client.auth_code.get_token(verifier, {:redirect_uri => access_token_callback_url}.merge(token_params.to_hash(:symbolize_keys => true)), deep_symbolize(options.auth_token_params))
end
raw_info() click to toggle source
# File lib/omniauth/strategies/chatwork.rb, line 37
def raw_info
  @raw_info ||= access_token.get("me").parsed || {}
end