I've setup a Ipython 3.2.1 Notebook server
. However, I'm looking for a way to add our own authentication rule, which means I want to add my own authentication security authentication mechanism similar to LDAP, OAuth
to notebook.
I don't want to use JupyterHub
, since it's too complex for me to use. However,
I know from this site two factor authentication with username and password for a Jupyter Notebook server that we can deal with " The login handler class to use.
c.NotebookApp.login_handler_class = 'notebook.auth.login.LoginHandler'
in notebook configure file, but I don't know how to do it, do I need to write another loginHandler
class to overwrite it? if so, which directory should I put this class file in?
Yes, you can modify the behavior of the LoginHandler
by extending it. Something like the code below where I am overwriting the method _render
.
class MyLoginHandler(LoginHandler):
def _render(self, message=None):
# ... this is my custom code
Then you have to modify the Jupyter file to something like:
c.NotebookApp.login_handler_class = 'myModule.MyLoginHandler'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With