# Jupyter-server keeps asking for token login

**URL:** <https://discourse.jupyter.org/t/jupyter-server-keeps-asking-for-token-login/20831>\
**Category:** Notebook\
**Created:** [August 9, 2023, 2:03pm UTC](https://discourse.jupyter.org/t/jupyter-server-keeps-asking-for-token-login/20831 "2023-08-09T14:03:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pkaramol](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/pkaramol/32/10682_2.png) [@pkaramol](https://discourse.jupyter.org/u/pkaramol)\
**Post date:** [August 9, 2023, 2:03pm UTC](https://discourse.jupyter.org/t/jupyter-server-keeps-asking-for-token-login/20831/1 "2023-08-09T14:03:42Z")

</div>

Ι have set up a jupyter server instance on kubernetes. The login prompt screen is the following

[![enter image description here](https://i.stack.imgur.com/MYWmb.png)](https://i.stack.imgur.com/MYWmb.png)

I exec into the pod, run `jupyter notebook list`, and in the two boxes at the bottom of the screenshot I enter the token returned by the above command and a password.

I then log in, log out and I am prompted **again** with the same screen

When I insert the password / token I created in the previous step in the `Password or token` field at the top of the screen, I get an invalid credentials response.

How can I set up a password-only authentication?

The links in the screenshot point to 404 pages.

```auto
jupyter --version
jupyter core : 4.6.3
jupyter-notebook : 6.1.4
qtconsole : not installed
ipython : 7.18.1
ipykernel : 5.3.4
jupyter client : 6.1.7
jupyter lab : 2.2.8
nbconvert : 6.0.7
ipywidgets : 7.5.1
nbformat : 5.0.7
traitlets : 5.0.4

```

---

<div class="post-metadata">

**Author:** ![minrk](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/minrk/32/13_2.png) [@minrk](https://discourse.jupyter.org/u/minrk)\
**Post date:** [August 10, 2023, 7:47am UTC](https://discourse.jupyter.org/t/jupyter-server-keeps-asking-for-token-login/20831/2 "2023-08-10T07:47:25Z")

</div>

> [@pkaramol](#):
>
> How can I set up a password-only authentication?

You can run the command

```auto
jupyter server password

```

(or in your case, since you appear to be using the older notebook server, `jupyter notebook password`).

It will prompt for your password, and then create (or add to) a config file (`jupyter_server_config.json` for the new server, `jupyter_notebook_config.json` for the old one).

If you add `JUPYTER_CONFIG_DIR=$PWD`, then it will create this file in your current directory. You can then add this file to your container, and password authentication will be enabled with the password you specified.

For the full command (I’m using jupyter server):

```auto
$ JUPYTER_CONFIG_DIR=$PWD jupyter server password
Enter password:
Verify password:
[JupyterPasswordApp] Wrote hashed password to ./jupyter_server_config.json
$ cat jupyter_server_config.json
{
  "IdentityProvider": {
    "hashed_password": "argon2:$argon2id$v=19$m=10240,t=10,p=8$4wUfa8Ikw4hqftKpmYbgLA$QC/iREH2JhL9MV95Uqr5X6CVipzYdFfgS1TGtuy1Hlc"
  }
}

```

You can add this file via a secret volume to your container, e.g. mounting it in `/etc/jupyter/jupyter_server_config.json`

Again, if you are using the legacy notebook server, replace `server` with `notebook` in filenames and commands above.
