Permalink
Browse files

Integrate hashed passwords into the notebook.

  • Loading branch information...
1 parent 551f71e commit 3fe8501ccf31ee224ad6c218538e7de76f2d5459 @stefanv committed Nov 18, 2011
Showing with 13 additions and 2 deletions.
  1. +3 −1 IPython/frontend/html/notebook/handlers.py
  2. +10 −1 IPython/frontend/html/notebook/notebookapp.py
@@ -28,6 +28,7 @@
from IPython.external.decorator import decorator
from IPython.zmq.session import Session
+from IPython.lib.security import passwd_check
try:
from docutils.core import publish_string
@@ -174,7 +175,8 @@ def get(self):
def post(self):
pwd = self.get_argument('password', default=u'')
- if self.application.password and pwd == self.application.password:
+ if self.application.password and \
+ passwd_check(self.application.password, pwd):
self.set_secure_cookie('username', str(uuid.uuid4()))
self.redirect(self.get_argument('next', default='/'))
@@ -208,7 +208,16 @@ def _ip_changed(self, name, old, new):
)
password = Unicode(u'', config=True,
- help="""Password to use for web authentication"""
+ help="""Hashed password to use for web authentication.
+
+ To generate, do:
+
+ from IPython.lib import passwd
+
+ passwd('mypassphrase')
+
+ The string should be of the form type:salt:hashed-password.
+ """
)
open_browser = Bool(True, config=True,

0 comments on commit 3fe8501

Please sign in to comment.