diff --git a/notebook/notebookapp.py b/notebook/notebookapp.py index 57833caec..f72b222af 100755 --- a/notebook/notebookapp.py +++ b/notebook/notebookapp.py @@ -945,6 +945,10 @@ class NotebookApp(JupyterApp): if os.getenv('JUPYTER_TOKEN'): self._token_generated = False return os.getenv('JUPYTER_TOKEN') + if os.getenv('JUPYTER_TOKEN_FILE'): + self._token_generated = False + with io.open(os.getenv('JUPYTER_TOKEN_FILE'), "r") as token_file + return token_file.read() if self.password: # no token if password is enabled self._token_generated = False