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, #computed_settings, #default_settings, #login_path, #login_path_params, #logout_redirection_path, #name, #setup_proc
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
|
30
31
32
33
34
|
# File 'lib/mumukit/login/provider/auth0.rb', line 30
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
|
# File 'lib/mumukit/login/provider/auth0.rb', line 16
def (*)
<<HTML
<script src="https://cdn.auth0.com/js/lock/11.5.2/lock.min.js"></script>
HTML
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
22
23
24
25
26
27
28
|
# File 'lib/mumukit/login/provider/auth0.rb', line 22
def script_html(settings)
<<HTML
<script type="text/javascript">
new Auth0Lock('#{auth0_config.client_id}', '#{auth0_config.domain}', JSON.parse('#{settings}')).show();
</script>
HTML
end
|