Class: OmniAuth::Strategies::OpenEdx

Inherits:
OAuth2
  • Object
show all
Defined in:
lib/omniauth/strategies/open_edx.rb

Constant Summary collapse

DEFAULT_SCOPE =
"profile email"

Instance Method Summary collapse

Instance Method Details

#authorize_paramsObject



50
51
52
53
54
55
56
57
58
# File 'lib/omniauth/strategies/open_edx.rb', line 50

def authorize_params
  super.tap do |params|
    %w[scope].each do |v|
      params[v.to_sym] = request.params[v] if request.params[v]
    end

    params[:scope] ||= DEFAULT_SCOPE
  end
end

#callback_urlObject



43
44
45
46
47
48
# File 'lib/omniauth/strategies/open_edx.rb', line 43

def callback_url
  # overwrite this function from omniauth
  # https://github.com/omniauth/omniauth/blob/c2380ae848ce4e0e39b4bb94c5b8e3fd0a544825/lib/omniauth/strategy.rb#L444
  # edx greatly dislikes when query_string is part of the callback_url
  full_host + callback_path
end

#raw_infoObject



39
40
41
# File 'lib/omniauth/strategies/open_edx.rb', line 39

def raw_info
  @raw_info ||= jwt_payload
end