Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authentication and Authorization not working through config file of jupyter Server #1323

Open
ashu-soni-dsw opened this issue Sep 5, 2023 · 2 comments
Labels

Comments

@ashu-soni-dsw
Copy link

I am running a Jupyter environment (Jupyter Lab) inside a Docker container on a remote server. Inside the container I want to restrict the OS level access from the jupyter lab such that the user must not be able to open or read any file from a specific directory of a folder.

  • Progress till now:

  • Approach: I have created a custom authorization class that inherits the jupyter_server.auth.Authorizer class and overrides it’s is_authorized method. The goal is that, the custom class must have a logic to restrict the access to a certain folder (for example: “D:\New folder (2)”), such that, every time a user tries to access that particular folder a HTTPError(403) error is raised, and the request must be blocked. The location of custom class is in the same directory as the jupyter_server_config.py config file i.e. “C:\Users\ashus.jupyter”.

  • Inside config file:
    c.ServerApp.authorizer_class = ‘C:\Users\ashus.jupyter\CustomAuthorization.MyCustomAuthorizer’

  • Error: When I run the Jupyter Lab using anaconda3 command prompt I am facing the following error:

image

Please comment and help me in solving this issue.

@welcome
Copy link

welcome bot commented Sep 5, 2023

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively.
welcome
You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! 👋

Welcome to the Jupyter community! 🎉

@manics
Copy link
Contributor

manics commented Sep 5, 2023

Note this was cross posted on Discourse https://discourse.jupyter.org/t/restricting-os-level-access-from-jupyter-lab/21251

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants