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 #15079

Closed
ashu-soni-dsw opened this issue Sep 5, 2023 · 2 comments
Closed
Labels
bug status:Needs Triage Applied to new issues that need triage

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

@jupyterlab-probot jupyterlab-probot bot added the status:Needs Triage Applied to new issues that need triage label Sep 5, 2023
@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! 🎉

@krassowski
Copy link
Member

Thank you for opening this issue. In future please refrain from posing issues in multiple repositories. Since this is a question about jupyter-server, with an issue open over in jupyter-server/jupyter_server#1323 and a Discourse thread I will close this one as it is not a bug in JupyterLab itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug status:Needs Triage Applied to new issues that need triage
Projects
None yet
Development

No branches or pull requests

2 participants