the-littlest-jupyterhub icon indicating copy to clipboard operation
the-littlest-jupyterhub copied to clipboard

[GitHub] Config option `allowed_organizations` is not working

Open saurabh-glam opened this issue 3 years ago • 3 comments

Bug description

This is my /opt/tljh/config/config.yaml file:

users:
  admin:
  - abc
  - abc
auth:
  type: oauthenticator.github.GitHubOAuthenticator
  GoogleOAuthenticator:
    client_id: ---
    client_secret: ---
    oauth_callback_url: ---
  FirstUseAuthenticator:
    create_users: true
  GitHubOAuthenticator:
    client_id: ---
    client_secret: ---
    oauth_callback_url: ---
    allowed_organizations:
      - my_org_name
    scope:
      - read:user
services:
  cull:
    timeout: 600000

Expected behaviour

While signing in via GitHub, if the org is not my_org_name then it shouldn't login.

Actual behaviour

While signing in via GitHub, if the org is not my_org_name then it is logging in.

How to reproduce

  1. Go to server and update the config file by adding allowed_organizations: ... and reload using sudo tljh-config reload
  2. Click to your hub url, signin with GitHub (from an account which is not a part of organization mentioned in tljh-config)
  3. Authorise and It will login :(

Your personal set up

using a distribution of the-littlest-jupyterhub.

ubuntu 20.04 cloud: AWS instance type: t3.large

Configuration
# jupyterhub_config.py
c.GitHubOAuthenticator.allowed_organizations = ['my_org_name']

saurabh-glam avatar Apr 06 '22 13:04 saurabh-glam

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! :hugs:
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! :wave:
Welcome to the Jupyter community! :tada:

welcome[bot] avatar Apr 06 '22 13:04 welcome[bot]

I ran into the same issue, @saurabh-glam did you figure out a solution?

quan3010 avatar Jul 25 '22 01:07 quan3010

@quan3010 No I did not find a solution, this is still an issue for me.

I am using LocalGitHubOAuthenticator until this issue is resolved, where I am whitelisting users based on their github usernames.

saurabh-glam avatar Jul 25 '22 09:07 saurabh-glam