Announcing JupyterHub LTI Authenticator

262 views
Skip to first unread message

Yuvi Panda

unread,
Jan 10, 2018, 7:15:04 PM1/10/18
to Project Jupyter
Hello!

A bit late, but am happy to announce an LTI Authenticator for JupyterHub! LTI (https://www.imsglobal.org/activity/learning-tools-interoperability) is popular among many educational products, such as Canvas / BlackBoard / Moodle / EdX, etc. This authenticator allows sharing authentication information between such products and JupyterHub!

You can find documentation + install instructions at https://github.com/yuvipanda/jupyterhub-ltiauthenticator. I have currently only tested this with EdX, so if anyone else has access to any other LTI Provider am happy to help test + fix.

Thanks to UC Berkeley's Data Sciences Division & Berkeley Institute of Data Science for support in building this authenticator!

Brian Granger

unread,
Jan 10, 2018, 7:20:19 PM1/10/18
to Project Jupyter
Wow, this is absolutely fantastic! I think this will go a long way
towards helping campus adoptions. Thanks for sharing this.

Cheers,

Brian
> --
> You received this message because you are subscribed to the Google Groups
> "Project Jupyter" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jupyter+u...@googlegroups.com.
> To post to this group, send email to jup...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jupyter/ac97747f-0ff6-429b-b3e3-d73c343b4c81%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
Brian E. Granger
Associate Professor of Physics and Data Science
Cal Poly State University, San Luis Obispo
@ellisonbg on Twitter and GitHub
bgra...@calpoly.edu and elli...@gmail.com

amenokal

unread,
May 3, 2018, 5:43:37 AM5/3/18
to Project Jupyter
Hello,
THank you very much !
Who can use this to connect moodle and jupyterhub ?
I need some help to set up.
amenokal

Rod Norfor

unread,
May 3, 2018, 2:28:49 PM5/3/18
to Project Jupyter
If you are running version 0.6, and probably later (but I haven't tried later) of the jupyterhub chart,

you need to specify the LTI Client Key and Secret in you chart.yaml you use to deploy:

auth:
    type: "lti"
    lti:
       consumers: { "e9b8d32396af626d2c45f860d643ff0dc72a51f1e729e7eeb46f086816a7e8ba":  "a87553942c359c864e0f6e0c16e76dcec35e88157e3a4babcd8e394b23d45b91"}

then in moodle configure the external tool activity module to use the Client Key and Secret you specified
in the chart.yaml.


The url for the jupyter will be domain.name/hub/lti/launch


Regards.

Rod

Rafik Abdesselam

unread,
May 4, 2018, 2:50:29 AM5/4/18
to jup...@googlegroups.com
Hi Rod,
Thank's for your reply,
Please :
       consumers: { "e9b8d32396af626d2c45f860d643ff0dc72a51f1e729e7eeb46f086816a7e8ba":  "a87553942c359c864e0f6e0c16e76dcec35e88157e3a4babcd8e394b23d45b91"}

from where come these two strings, the api token of jupyterhub ?

Have a good day,

A


--
You received this message because you are subscribed to the Google Groups "Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+unsubscribe@googlegroups.com.

To post to this group, send email to jup...@googlegroups.com.

Rod Norfor

unread,
May 4, 2018, 4:40:45 AM5/4/18
to Project Jupyter
They can be whatever you want,

I used 'openssl rand -hex 32', to generate them, in the same way that you generate the api token,

they could probably be the same, but that isn't a good idea....
 
and then you use them as the client key and secret when configuring the moodle external tool ( "client_key": "secret")

Regards.

Rod
To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+u...@googlegroups.com.

To post to this group, send email to jup...@googlegroups.com.

Rafik Abdesselam

unread,
May 4, 2018, 11:18:01 AM5/4/18
to jup...@googlegroups.com
Thank's Rod for your patience, it's seems it's working, with a frame in the moodle page, but two things :
- the browser block the content,
- I think there is some tweaks to connect the student to the right notebook.
Tell me, & thanks,
A.

To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+unsubscribe@googlegroups.com.

To post to this group, send email to jup...@googlegroups.com.

Rod Norfor

unread,
May 5, 2018, 2:21:22 PM5/5/18
to Project Jupyter
Is the browser blocking the content because of either not having a certificate or having a self-signed certificate,

I configured the let's encrypt certificate and didn't have a problem.

Are you creating your own singleuser image with the notebooks in?

Regards.

Rod

Rafik Abdesselam

unread,
May 11, 2018, 10:31:09 AM5/11/18
to jup...@googlegroups.com
Hi Rod
Sorry for the lag, but time is necessary to build the right conf in an "universitary framework" 

I have a persistant error.

Please let me describe you my configuration :
- on a local server ubuntu 16.04, I have moodle 3.4 and jupyter 0.0.8, configured with https, each working well,
- I installed the script $ sudo pip install jupyterhub-ltiauthenticator
- in the jupyterhub_config.py, I add
 c.LTIAuthenticator.consumers = {
"client_key": "secret"
}
- "client_key" and "secret"  generated by 'openssl rand -hex 32'
- in moodle, i add an External tool configuration with the url 'https://127.0.0.1/hub/lti/launch' and 
' Consumer key'=' client_key ' and  ' Shared secret '='secret'

but JupyterHub crashed, here an extract of the jupyter log :
"[I 2018-05-11 16:13:54.584 JupyterHub app:1539] Hub API listening on http://127.0.0.1:8081/hub/
[W 2018-05-11 16:13:54.585 JupyterHub proxy:415]
    Generating CONFIGPROXY_AUTH_TOKEN. Restarting the Hub will require restarting the proxy.
    Set CONFIGPROXY_AUTH_TOKEN env or JupyterHub.proxy_auth_token config to avoid this message.

[I 2018-05-11 16:13:54.586 JupyterHub proxy:458] Starting proxy @ https://jupyter.univexemple.com:443/
[D 2018-05-11 16:13:54.586 JupyterHub proxy:459] Proxy cmd: ['configurable-http-proxy', '--ip', 'jupyter.univexemple.com', '--port', '443', '--api-ip', '127.0.0.1', '--api-port', '8001', '--error-target', 'http://127.0.0.1:8081/hub/error', '--ssl-key', '/etc/jupyterhub/jupyter.univexemple.key', '--ssl-cert', '/etc/jupyterhub/jupyter.univexemple.crt']
[D 2018-05-11 16:13:54.590 JupyterHub proxy:491] Proxy started and appears to be up
[D 2018-05-11 16:13:54.591 JupyterHub proxy:552] Proxy: Fetching GET http://127.0.0.1:8001/api/routes
[E 2018-05-11 16:13:54.614 JupyterHub app:1634]
    Traceback (most recent call last):
      File "/usr/local/lib/python3.5/dist-packages/jupyterhub/app.py", line 1632, in launch_instance_async
        yield self.start()
      File "/usr/local/lib/python3.5/dist-packages/jupyterhub/app.py", line 1580, in start
        yield self.proxy.check_routes(self.users, self._service_map)
      File "/usr/local/lib/python3.5/dist-packages/jupyterhub/proxy.py", line 294, in check_routes
        routes = yield self.get_all_routes()
      File "/usr/local/lib/python3.5/dist-packages/jupyterhub/proxy.py", line 589, in get_all_routes
        resp = yield self.api_request('', client=client)
    tornado.httpclient.HTTPError: HTTP 403: Forbidden

[D 2018-05-11 16:13:54.637 JupyterHub application:647] Exiting application: jupyterhub"

Please tell me where I am wrong.

Regards

Amenokal




To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+unsubscribe@googlegroups.com.

To post to this group, send email to jup...@googlegroups.com.

Rod Norfor

unread,
May 12, 2018, 4:50:26 PM5/12/18
to Project Jupyter
in jupyterhub_config.py have you enabled the Authenticator with the line:
c.JupyterHub.authenticator_class = 'ltiauthenticator.LTIAuthenticator'

I assume jupyter.univexemple.com resolves to 127.0.0.1

are you loading the custom jupyterhub_config.py via the '-f' argument?

Is your web server configured for ssl? would that already be running on port 443 on 127.0.0.1?

Regards.

Rod
Reply all
Reply to author
Forward
0 new messages