-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Launch the browser with a redirect file
This avoids putting the authentication token into a command-line argument to launch the browser, where it's visible to other users. Filesystem permissions should ensure that only the user who started the notebook can use this route to authenticate. Thanks to Dr Owain Kenway for suggesting this technique.
- Loading branch information
Showing
3 changed files
with
95 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{# This template is not served, but written as a file to open in the browser, | ||
passing the token without putting it in a command-line argument. #} | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta http-equiv="refresh" content="1;url={{ open_url }}" /> | ||
<title>Opening Jupyter Notebook</title> | ||
</head> | ||
<body> | ||
|
||
<p> | ||
This page should redirect you to Jupyter Notebook. If it doesn't, | ||
<a href="{{ open_url }}">click here to go to Jupyter</a>. | ||
</p> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
270c0f9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please review the commit...
Some browsers are having issues opening the file.
Personally, I get the following (notebook does start, have to copy link manually) on Chromium 74.0.3729.169 (Official Build) on Ubuntu 18.04
#2923
#4353
Update: works fine on Firefox.
Update2: Also works on Chrome 74.0.3729.169 (Official Build) (same as chromium)
270c0f9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think some of the bugs (including #4500) may be conflating multiple issues. I've updated #4500 with some more details on the Ubuntu problem, I think changing the directory for the nbserver--open.html file would resolve the issues.