# Access the Jupyter Notebook by passing the credentials in URL

**URL:** <https://discourse.jupyter.org/t/access-the-jupyter-notebook-by-passing-the-credentials-in-url/4908>\
**Category:** JupyterHub\
**Created:** [June 18, 2020, 7:46pm UTC](https://discourse.jupyter.org/t/access-the-jupyter-notebook-by-passing-the-credentials-in-url/4908 "2020-06-18T19:46:42Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![psychemedia](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/psychemedia/32/24_2.png) [@psychemedia](https://discourse.jupyter.org/u/psychemedia)\
**Post date:** [June 23, 2020, 4:02pm UTC](https://discourse.jupyter.org/t/access-the-jupyter-notebook-by-passing-the-credentials-in-url/4908/3 "2020-06-23T16:02:08Z")

</div>

If you manage the notebook server, I think you can define the token when you start the server and open a notebook directly by passing in the token:

`jupyter notebook --NotebookApp.tokenUnicode ="mytoken"`

If you set it to ‘’ then authentication is disabled.

(NB the current docs seem to specify `NotebookApp.tokenUnicode` but I’m sure I’ve always used `NotebookApp.token` in the past. I don’t know if there is a change note about this somewhere, or whether `NotebookApp.token` now breaks. If so, I may have some nightmare maintenance to do…!)

You can then launch with:

`open "http://localhost:8888?token=mytoken".`

If you are using docker to run notebooks via the official Jupyter containers, you can pass in a token when you run the container:

`docker run --rm -d --name democontainer -p 9999:8888 -e JUPYTER_TOKEN="mytoken" jupyter/base-notebook`

Or define an environment variable:  
`export JUPYTER_TOKEN='mytoken' `

and then run:

`docker run --rm -d --name democontainer -p 9999:8888 -e JUPYTER_TOKEN jupyter/base-notebook`

and open with:

`open "http://localhost:9999?token=${JUPYTER_TOKEN}"`

Alternatively, you can set `c.NotebookApp.tokenUnicode` in the `~/.jupyterjupyter_notebook_config.py` file as required (see the [docs](https://jupyter-notebook.readthedocs.io/en/stable/config.html).

---

_[View the full topic](https://discourse.jupyter.org/t/access-the-jupyter-notebook-by-passing-the-credentials-in-url/4908)._
