Skip to content

Jupyter Token Authentication

Doron Rosenberg edited this page Jan 18, 2017 · 1 revision

EclairJS Server uses Jupyter and as of Jupyter 4.3.0, Jupyter has a new authentication model based on tokens.

In Jupyter 4.3.0 and higher, when you start it it now outputs the following message:

    Copy/paste this URL into your browser when you connect for the first time,
    to login with a token:
        http://localhost:8888/?token=db6abf809182d07deb360f70faaf1d26524bbde27d84d65d

When connecting EclairJS Client to such an instance, you will see an error message (along the lines of API request failed). To fix this, you have two choices:

  1. Disable the new token authentication in Jupyter by starting it like this:
```bash
$ jupyter notebook --no-browser --NotebookApp.token='' --NotebookApp.disable_check_xsrf=True
``` 

This disables the new authentication model, which has security implications.
  1. Instead of setting JUPYTER_HOST, you can set a new environment variable called JUPYTER_URL and set it to the url that gets printed out when Jupyter is started:
```bash
export JUPYTER_URL=http://localhost:8888/?token=db6abf809182d07deb360f70faaf1d26524bbde27d84d65d
```

Eclair JS Client 0.10.1 and higher support this new environment variable and will handle the authentication token for you.