Class: Mumukit::Login::Provider::Auth0

Inherits:
Base
  • Object
show all
Defined in:
lib/mumukit/login/provider/auth0.rb

Instance Method Summary collapse

Methods inherited from Base

#auth_path, #button_html, #callback_path, #configure_rails_forgery_protection!, #login_path, #logout_redirection_path, #name

Instance Method Details

#configure_omniauth!(omniauth) ⇒ Object



2
3
4
5
6
7
8
# File 'lib/mumukit/login/provider/auth0.rb', line 2

def configure_omniauth!(omniauth)
  omniauth.provider :auth0,
                    auth0_config.client_id,
                    auth0_config.client_secret,
                    auth0_config.domain,
                    callback_path: callback_path
end


26
27
28
29
30
# File 'lib/mumukit/login/provider/auth0.rb', line 26

def footer_html(*)
  '<a href="https://auth0.com/" target="_blank">
      <img height="40" alt="JWT Auth for open source projects" src="//cdn.auth0.com/oss/badges/a0-badge-light.png"/>
   </a>'
end

#header_htmlObject



19
20
21
22
23
24
# File 'lib/mumukit/login/provider/auth0.rb', line 19

def header_html(*)
  "<script src=\"https://cdn.auth0.com/js/lock-7.12.min.js\"></script>\n</script>\n"
end

#request_authentication!(controller, login_settings) ⇒ Object



10
11
12
13
14
15
16
17
# File 'lib/mumukit/login/provider/auth0.rb', line 10

def request_authentication!(controller, )
  settings = lock_settings(controller, , {closable: false})
  controller.render_html! " <script type=\"text/javascript\">\n    new Auth0Lock('\#{auth0_config.client_id}', '\#{auth0_config.domain}').show(\#{settings});\n</script>\n"
end