Show More
@@ -28,6 +28,7 b' from zmq.utils import jsonapi' | |||||
28 |
|
28 | |||
29 | from IPython.external.decorator import decorator |
|
29 | from IPython.external.decorator import decorator | |
30 | from IPython.zmq.session import Session |
|
30 | from IPython.zmq.session import Session | |
|
31 | from IPython.lib.security import passwd_check | |||
31 |
|
32 | |||
32 | try: |
|
33 | try: | |
33 | from docutils.core import publish_string |
|
34 | from docutils.core import publish_string | |
@@ -174,7 +175,8 b' class LoginHandler(AuthenticatedHandler):' | |||||
174 |
|
175 | |||
175 | def post(self): |
|
176 | def post(self): | |
176 | pwd = self.get_argument('password', default=u'') |
|
177 | pwd = self.get_argument('password', default=u'') | |
177 |
if self.application.password and |
|
178 | if self.application.password and \ | |
|
179 | passwd_check(self.application.password, pwd): | |||
178 | self.set_secure_cookie('username', str(uuid.uuid4())) |
|
180 | self.set_secure_cookie('username', str(uuid.uuid4())) | |
179 | self.redirect(self.get_argument('next', default='/')) |
|
181 | self.redirect(self.get_argument('next', default='/')) | |
180 |
|
182 |
@@ -208,7 +208,16 b' class NotebookApp(BaseIPythonApplication):' | |||||
208 | ) |
|
208 | ) | |
209 |
|
209 | |||
210 | password = Unicode(u'', config=True, |
|
210 | password = Unicode(u'', config=True, | |
211 |
help=""" |
|
211 | help="""Hashed password to use for web authentication. | |
|
212 | ||||
|
213 | To generate, do: | |||
|
214 | ||||
|
215 | from IPython.lib import passwd | |||
|
216 | ||||
|
217 | passwd('mypassphrase') | |||
|
218 | ||||
|
219 | The string should be of the form type:salt:hashed-password. | |||
|
220 | """ | |||
212 | ) |
|
221 | ) | |
213 |
|
222 | |||
214 | open_browser = Bool(True, config=True, |
|
223 | open_browser = Bool(True, config=True, |
General Comments 0
You need to be logged in to leave comments.
Login now