class OmniAuth::Strategies::Kakao

Constants

DEFAULT_REDIRECT_PATH

Public Class Methods

new(app, *args, &block) click to toggle source
Calls superclass method
# File lib/omniauth/strategies/kakao.rb, line 29
def initialize(app, *args, &block)
  super
  options[:callback_path] = options[:redirect_path] || DEFAULT_REDIRECT_PATH
end

Public Instance Methods

callback_phase() click to toggle source
Calls superclass method
# File lib/omniauth/strategies/kakao.rb, line 34
def callback_phase
  previous_callback_path = options.delete(:callback_path)
  @env["PATH_INFO"] = callback_path
  options[:callback_path] = previous_callback_path
  super
end
callback_url() click to toggle source

callback_uri와 관련해서 redirect_uri_mismatch 문제가 나오던것을 path match를 통해서 해결합니다. 해당 문제는 devtalk.kakao.com/t/rest-api-omniauth/19207 에서 나오는 문제를 해결합니다. NOTE If we're using code from the signed request then FB sets the redirect_uri to '' during the authorize

phase and it must match during the access_token phase:
https://github.com/facebook/facebook-php-sdk/blob/master/src/base_facebook.php#L477
# File lib/omniauth/strategies/kakao.rb, line 46
def callback_url
  if @authorization_code_from_signed_request_in_cookie
    ''
  else
    # callback url ignorance issue from https://github.com/intridea/omniauth-oauth2/commit/85fdbe117c2a4400d001a6368cc359d88f40abc7
    options[:callback_url] || (full_host + script_name + callback_path)
  end
end
mock_call!(*) click to toggle source
Calls superclass method
# File lib/omniauth/strategies/kakao.rb, line 55
def mock_call!(*)
  options.delete(:callback_path)
  super
end

Private Instance Methods

raw_info() click to toggle source
# File lib/omniauth/strategies/kakao.rb, line 61
def raw_info
  @raw_info ||= access_token.get('https://kapi.kakao.com/v1/user/me', {}).parsed || {}
end
raw_properties() click to toggle source
# File lib/omniauth/strategies/kakao.rb, line 65
def raw_properties
  @raw_properties ||= raw_info.fetch('properties', {})
end