Skip to content

Commit 7e04105

Browse files
committed
enable user auth state
1 parent 246599d commit 7e04105

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

images/jupyter-hub/jupyterhub_config.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,16 @@ def per_user_profiles(spawner):
169169
# Try to validate session / refresh token every 10 minutes
170170
c.Authenticator.auth_refresh_age = 600
171171

172+
# Needed to save refresh token
173+
c.Authenticator.enable_auth_state = True
174+
175+
if 'JUPYTERHUB_CRYPT_KEY' not in os.environ:
176+
app_log.warn(
177+
"Need JUPYTERHUB_CRYPT_KEY env for persistent auth_state.\n"
178+
" export JUPYTERHUB_CRYPT_KEY=$(openssl rand -hex 32)"
179+
)
180+
c.CryptKeeper.keys = [ os.urandom(32) ]
181+
172182
"""
173183
EXTRAS
174184
"""

images/jupyter-hub/utils/jupyterhub_utils/authenticator.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,4 +110,3 @@ def _get_token(url: str) -> str:
110110
app_log.error("url:\n%s", url)
111111
raise HTTPError(500, f"url: {url}")
112112
return parts[1]
113-

0 commit comments

Comments
 (0)