Class: Mumukit::Login::Provider::Auth0
- Inherits:
-
Base
- Object
- Base
- Mumukit::Login::Provider::Auth0
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
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
|
31
32
33
34
35
|
# File 'lib/mumukit/login/provider/auth0.rb', line 31
def (*)
'<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
|
16
17
18
19
20
21
|
# File 'lib/mumukit/login/provider/auth0.rb', line 16
def (*)
" <script src=\"https://cdn.auth0.com/js/lock/10.14.0/lock.min.js\"></script> \n </script>\n"
end
|
#request_authentication!(controller, login_settings) ⇒ Object
10
11
12
13
14
|
# File 'lib/mumukit/login/provider/auth0.rb', line 10
def request_authentication!(controller, login_settings)
settings = lock_settings(controller, login_settings, {closable: false})
controller.render_html! header: ,
body: script_html(settings)
end
|
#script_html(settings) ⇒ Object
23
24
25
26
27
28
29
|
# File 'lib/mumukit/login/provider/auth0.rb', line 23
def script_html(settings)
"<script type=\"text/javascript\"> \n new Auth0Lock('\#{auth0_config.client_id}', '\#{auth0_config.domain}', JSON.parse('\#{settings}')).show(); \n</script>\n"
end
|